Correct way of plotting images
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Adam
am 19 Jul. 2016
'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.
Antworten (2)
Thorsten
am 19 Jul. 2016
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 Kommentare
Thorsten
am 19 Jul. 2016
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
am 19 Jul. 2016
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 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!