what is the difference between imshow(im) or imshow(im, [])

2 views (last 30 days)
where im=imread('lena256.bmp');

Answers (1)

David Young
David Young on 16 Mar 2015
If the second argument is not a spatial referencing object, a colormap or a string, it specifies the display range. From the documentation :
"'DisplayRange' — Display range of grayscale image[min(I(:)) max(I(:))] (default) | two-element vector
"Display range of a grayscale image, specified as a two-element vector [LOW HIGH]. imshow displays the value low (and any value less than low) as black, and the value high (and any value greater than high) as white. Values in between are displayed as intermediate shades of gray, using the default number of gray levels. If you specify an empty matrix ([]), imshow uses [min(I(:)) max(I(:))]; that is, use the minimum value in I as black, and the maximum value as white."
The last sentence describes your case. I think the documentation is a little unhelpful, in that the description of the display range argument does not give full details, and does not refer forwards to the description of the display range given as a name-value pair.

Categories

Find more on Display Image in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!