how do I make this image whietish?

조회 수: 4 (최근 30일)
Wonwoo Cho
Wonwoo Cho 2021년 12월 13일
편집: DGM 2022년 11월 13일
How do I make this first image like this second image?

채택된 답변

Yusuf Suer Erdem
Yusuf Suer Erdem 2021년 12월 13일
  댓글 수: 1
Wonwoo Cho
Wonwoo Cho 2021년 12월 13일
Thank You sir, you saved me :D

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

DGM
DGM 2022년 11월 13일
편집: DGM 2022년 11월 13일
To recreate this image in this specific example, we might compare it directly to its source and see what's been changed. Unfortunately, the result is a screenshot, so it's not the right size and it has then been subsequently cropped so that some edges are missing and others have padding. Stop saving images by saving the figure. It's only slightly less ridiculous than taking a tilted portrait photograph of the monitor with a cell phone.
So let's say we went out of our way to try to resize/crop/fill the image back into rough correspondence with the original. Then we could compare the two. I'm going to assume that whatever transformation was applied was applied equally to all channels.
A = imread('peppers.png'); % the original
B = imread('cccc.png'); % the garbage image
% try to figure out what each input value maps to
av0 = im2double(A(:));
bv0 = im2double(B(:));
[av idx] = unique(av0);
bv = zeros(size(av));
for k = 1:numel(av)
idx = av0 == av(k);
thesepix = bv0(idx);
bv(k) = median(thesepix);
end
plot(av,bv)
xlim([0 1])
ylim([0 1])
Why am I binning and finding the median for all the pixels instead of just comparing each one? That's because two pixels with the same value in A won't necessarily map to the same value in B -- because B is a significantly degraded copy of what used to be the actual output. B has been subject to interpolation when displayed, and again when saved. Whenever the saved image was then opened and edited manually, any number of other things might have happened. Yet more interpolation happens when B was rescaled to register it with A. Everything is blurred and slightly misaligned. If we had just tried to compare the pixel values directly, this is all we'd see:
If we can get a clear plot, we try to see if there's an obvious indication of what the initial value transformation was. Given the roughly piecewise-linear plot, it looks like a basic levels adjustment. Maybe there's a bit of gamma; maybe that's just reading tea leaves.
C = imadjust(A,[0 0.2],[0.2 1],1.2); % recreate the requested image
montage({B,C})
That looks about right.
See also:

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by