what is the difference between imshow(image) and imshow(image,[]) I am getting different images for this different lines, but I am not getting the logic behind it, can anybody help me for this...

4 commentaires

Al Bashir
Al Bashir le 9 Fév 2017
Modifié(e) : Al Bashir le 9 Fév 2017
imshow(I) (I = image) imshow(I) displays the image I in a graphics figure, where I is a grayscale, RGB (truecolor), or binary image. For binary images, imshow displays pixels with the value 0 (zero) as black and 1 as white.
imshow(I,[]) imshow(I,[low high]) displays the grayscale image I, specifying the display range as a two-element vector, [low high]. For more information, see the DisplayRange parameter .
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, the minimum value in I is black, and the maximum value is white.
Guillaume
Guillaume le 9 Fév 2017
Modifié(e) : Guillaume le 9 Fév 2017
Al Bashir, you should post your answer as an actual answer below. That way, Ajay can accept your answer and you get reputation. Plus, Ajay will be notified that an answer has been posted. Comments don't get notified, so he/she probably doesn't even know you've answered his question.
Jan
Jan le 2 Oct 2017
@Somaye Ahmadi: Flags are used to inform the admins and editors about contributions, which might conflict with the terms of use, e.g. by rudeness or illegal content. Please do not use them to post comments. Thanks.
Somaye Ahmadi
Somaye Ahmadi le 23 Oct 2017
@Jan Simon: Thanks for your comment. I didn't know. I'm so sorry.

Connectez-vous pour commenter.

 Réponse acceptée

Rik
Rik le 9 Fév 2017

1 vote

If you type "help imshow" or "doc imshow", you can read what Al Bashir said in his comment. In my copy of Matlab the first lines of the help read:
imshow(I) displays the grayscale image I.
imshow(I,[LOW HIGH]) displays the grayscale image I, specifying the display
range for I in [LOW HIGH]. The value LOW (and any value less than LOW)
displays as black, the value HIGH (and any value greater than HIGH) displays
as white. Values in between are displayed as intermediate shades of gray,
using the default number of gray levels.
imshow(I,[]) displays the grayscale image I scaling the display based
on the range of pixel values in I. imshow uses [min(I(:)) max(I(:))] as
the display range, that is, the minimum value in I is displayed as
black, and the maximum value is displayed as white.
imshow(RGB) displays the truecolor image RGB.

10 commentaires

Somaye Ahmadi
Somaye Ahmadi le 2 Oct 2017
Modifié(e) : Somaye Ahmadi le 2 Oct 2017
May I ask you something?What is your Matlab version?
The help of my Matlab doe not have that!!!!
Thanks
Jan
Jan le 2 Oct 2017
@Somaye Ahmadi: You can use the online docs of the current version: https://www.mathworks.com/help/images/ref/imshow.html There you find, that this command is part of the Image Processing Toolbox. Do you have it?
Somaye Ahmadi
Somaye Ahmadi le 19 Oct 2017
Modifié(e) : Somaye Ahmadi le 19 Oct 2017
@Jan Simon, many thanks for your reply and the link...it's so useful,thank you so much. No I don't,I should update my Matlab to newer version! Thanks
Rik
Rik le 19 Oct 2017
Updating your Matlab version will very likely not help. The Image Processing Toolbox is a toolbox, which is the name for a package of functions that is licensed separately from the main program. So it depends on your license, not your release. (unless of course you are using an ancient release from before the introduction of this toolbox, but I doubt you'dd get a release that old to work on something later than Windows XP)
Somaye Ahmadi
Somaye Ahmadi le 23 Oct 2017
@Rik Wisselink:Thanks for your reply.Thanks
Zeeshan Ahmad Khalil
Zeeshan Ahmad Khalil le 27 Avr 2018
Thanks
Ayman Alawin
Ayman Alawin le 10 Juil 2018
Not clear
Rik
Rik le 10 Juil 2018
@Ayman, what is not clear?
Adam
Adam le 10 Juil 2018
imshow is part of base Matlab. Maybe it was in the Image Processing Toolbox once, but I don't remember it being.
Rik
Rik le 10 Juil 2018
There is indeed also a doc page for the base Matlab function: here. Interesting to see the differences with the IPT version of the doc. Anyway, either contains the part I quoted.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Display Image dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by