Image Processing Toolbox User's Guide |
Syntax
imshow(I) imshow(I,[low high]) imshow(RGB) imshow(BW) imshow(X,map) imshow(filename) himage = imshow(...) imshow(...,param1,val1,param2,val2)
Description
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. If you use an empty matrix ([]
) for [low high]
, imshow
uses [min(I(:)) max(I(:))]
; 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
.
imshow(BW)
displays the binary image BW
. imshow
displays pixels with the value 0
(zero) as black and pixels with the value 1
as white.
imshow(X,map)
displays the indexed image X
with the colormap map
. A color map matrix may have any number of rows, but it must have exactly 3 columns. Each row is interpreted as a color, with the first element specifying the intensity of red light, the second green, and the third blue. Color intensity can be specified on the interval 0.0 to 1.0.
imshow
(filename)
displays the image stored in the graphics file filename
. The file must contain an image that can be read by imread
or dicomread.
imshow
calls imread
or dicomread
to read the image from the file, but does not store the image data in the MATLAB workspace. If the file contains multiple images, the first one will be displayed. The file must be in the current directory or on the MATLAB path.
himage = imshow(...)
returns the handle to the image object created by imshow
.
imshow(...,
param1,val1,param2,val2,...)
displays the image, specifying parameters and corresponding values that control various aspects of the image display. The following table lists all imshow
parameters. Parameter names can be abbreviated, and case does not matter..
Class Support
A truecolor image can be uint8
, uint16
, double
, or single
. An indexed image can be logical
, uint8
, double
, or single
. An intensity image can be logical
, uint8
, double
, single
, int16
, or uint16
. The input image must be nonsparse.
If your image is int16
or single
, the CData in the resulting image object will be double
. For all other classes, the CData matches the input image class..
Related Toolbox Preferences
You can use the iptsetpref
function to set several toolbox preferences that modify the behavior of imshow
.
'ImshowBorder'
controls whether imshow
displays the image with a border around it.
'ImshowAxesVisible'
controls whether imshow
displays the image with the axes box and tick labels.
'ImshowInitialMagnification'
controls the initial magnification for image display, unless you override it in a particular call by specifying imshow(...,'InitialMagnification',initial_mag)
.
For more information about these preferences, see iptsetpref
.
Remarks
imshow
is the toolbox's fundamental image display function, optimizing figure, axes, and image object property settings for image display. imtool
provides all the image display capabilities of imshow
but also provides access to several other tools for navigating and exploring images, such as the Pixel Region tool, Image Information tool, and the Adjust Contrast tool. imtool
presents an integrated environment for displaying images and performing some common image processing tasks.
Examples
Display an intensity image, adjusting the diplay range
See Also
imread
, imtool
, iptgetpref
, iptsetpref
, subimage
, truesize
, warp
image
, imagesc
in the MATLAB Function Reference
imscrollpanel | imsubtract |
© 1994-2005 The MathWorks, Inc.