Correct way of plotting images
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi community,
I need to know what's the correct way of plotting an image. Let's say I have an original grayscale [0-255] image ( let's assume a complete black image I = zeros(256,256)) and then I add high noise to it ( J = I + sigma*randn(size(I)) ) which set the image range to something like [-220 220]. I have three methods to plot the image as follows (just assume the image is not converted to double):
1) imshow(J) - when I read other images, it's by default in uint8 type.
2) imshow(double(J), [])
3) imshow(double(J), [0 255])
Which one is "perceptually" the true representation of the noisy image? Does imshow() perform clipping/quantization? Many thanks in advance.
댓글 수: 3
Adam
2016년 7월 19일
'Perceptually correct' is a fairly subjective measure and the type of thing people do PhDs on so it isn't really trivial. You can make a decision based purely on the maths applied in each one or you can do a lot of reading to understand the intricacies of perceptual interpretation. It depends what you want to highlight though really. Stretching data values in not necessarily wrong because the individual data values are arbitrary anyway in terms of their absolute values.
답변 (2개)
Thorsten
2016년 7월 19일
I usually use
imshow(J, [])
to view the full range of data. In the end, data are always quantized to be shown as 24bit RGB images, assuming that you have a standard monitor that supports no higher resolution than 24bit.
댓글 수: 2
Thorsten
2016년 7월 19일
You're right. If you want to keep the intensity values in the range of the original values, you have to use
imshow(J, [0 255])
Image Analyst
2016년 7월 19일
imshow() does clip if you don't use []. If you use [], then it scales each image's min-to-max to 0-255. So to compare images on the same scale, you'll have to find the overall min and max of ALL images, then pass those in.
imshow(image1, [overallMin, overallMax]);
imshow(image2, [overallMin, overallMax]);
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!