Image Processing Toolbox    
imshow

Display an image

Syntax

Description

imshow(I,n) displays the intensity image I with n discrete levels of gray. If you omit n, imshow uses 256 gray levels on 24-bit displays, or 64 gray levels on other systems.

imshow(I,[low high]) displays I as a grayscale intensity image, specifying the data range for I. The value low (and any value less than low) displays as black, the value high (and any value greater than high) displays as white, and values in between display as intermediate shades of gray. imshow uses the default number of gray levels. If you use an empty matrix ([]) for [low high], imshow uses [min(I(:)) max(I(:))]; the minimum value in I displays as black, and the maximum value displays as white.

imshow(BW) displays the binary image BW. Values of 0 display as black, and values of 1 display as white.

imshow(X,map) displays the indexed image X with the colormap map.

imshow(RGB) displays the truecolor image RGB.

imshow(...,display_option) displays the image, calling truesize if display_option is 'truesize', or suppressing the call to truesize if display_option is 'notruesize'. Either option string can be abbreviated. If you do not supply this argument, imshow determines whether to call truesize based on the setting of the 'ImshowTruesize' preference.

imshow(x,y,A,...) uses the two-element vectors x and y to establish a nondefault spatial coordinate system, by specifying the image XData and YData.

imshow filename displays the image stored in the graphics file filename. imshow calls imread to read the image from the file, but the image data is not stored in the MATLAB workspace. The file must be in the current directory or on the MATLAB path.

h = imshow(...) returns the handle to the image object created by imshow.

Class Support

The input image can be of class logical, uint8, uint16, or double, and it must be nonsparse.

Remarks

You can use the iptsetpref function to set several toolbox preferences that modify the behavior of imshow. For example:

Note that the display_option argument to imshow enables you to override the 'ImshowTruesize' preference.

For more information about these preferences, see the reference entry for iptsetpref.

See Also

getimage, imread, iptgetpref, iptsetpref, subimage, truesize, warp

image, imagesc in the MATLAB Function Reference


  imrotate imsubtract