| Image Processing Toolbox™ | ![]() |
The Image Processing Toolbox software includes two display functions, imshow and imtool. Both functions work within the Handle Graphics architecture: they create an image object and display it in an axes object contained in a figure object.
imshow is the toolbox's fundamental image display function. Use imshow when you want to display any of the different image types supported by the toolbox, such as grayscale (intensity), truecolor (RGB), binary, and indexed. For more information, see Displaying Images Using the imshow Function. The imshow function is also a key building block for image applications you might want to create using the toolbox modular tools. For more information, see Building GUIs with Modular Tools.
The other toolbox display function, imtool, launches the Image Tool, which presents an integrated environment for displaying images and performing some common image processing tasks. The Image Tool provides all the image display capabilities of imshow but also provides access to several other tools for navigating and exploring images, such as scroll bars, the Pixel Region tool, the Image Information tool, and the Adjust Contrast tool. For more information, see Using the Image Tool to Explore Images.
In general, using the toolbox functions to display images is preferable to using MATLAB image display functions image and imagesc because the toolbox functions set certainHandle Graphics properties automatically to optimize the image display. The following table lists these properties and their settings for each image type. In the table, X represents an indexed image, I represents a grayscale image, BW represents a binary image, and RGB represents a truecolor image.
Note Both imshow and imtool can perform automatic scaling of image data. When called with the syntax imshow(I,'DisplayRange',[]), and similarly for imtool, the functions set the axes CLim property to [min(I(:)) max(I(:))]. CDataMapping is always scaled for grayscale images, so that the value min(I(:)) is displayed using the first colormap color, and the value max(I(:)) is displayed using the last colormap color. |
Handle Graphics Property | Indexed Images | Grayscale Images | Binary Images | Truecolor Images |
|---|---|---|---|---|
CData (Image) | Set to the data in X | Set to the data in I | Set to data in BW | Set to data in RGB |
CDataMapping (Image) | Set to 'direct' | Set to 'scaled' | Set to 'direct' | Ignored when CData is 3-D |
CLim (Axes) | Does not apply | double: [0 1] | Set to [0 1] | Ignored when CData is 3-D |
Colormap (Figure) | Set to data in map | Set to grayscale colormap | Set to a grayscale colormap whose values range from black to white | Ignored when CData is 3-D |
![]() | Displaying and Exploring Images | Displaying Images Using the imshow Function | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |