Image Processing Toolbox User's Guide |
Syntax
Description
impixelinfo
creates a pixel information tool in the current figure. The pixel information tool displays information about the pixel in an image that the cursor is positioned over. The tool displays pixel information for all the images in a figure..
The tool is a uipanel object, positioned in the lower-left corner of the figure. It contains the text string "Pixel info:" followed by the x and y coordinates of the pixel and its value, as shown in the following figure.
The information displayed depends on the image type. The following table shows the information displayed for each image type. If the cursor is outside of the image area in the figure, the pixel information tool displays the default pixel information string.
If you want to display the pixel information without the "Pixel Info" label, use the impixelinfoval function.
impixelinfo(h)
creates a pixel information tool in the figure specified by h
, where h
is a handle to an image, axes, uipanel, or figure object. Axes, uipanel, or figure objects must contain at least one image object.
impixelinfo(hparent,himage)
creates a pixel information tool in hparent
that provides information about the pixels in himage
. himage
is a handle to an image or an array of image handles. hparent
is a handle to the figure or uipanel object that contains the pixel information tool.
hpanel=impixelinfo(...)
returns a handle to the pixel information tool uipanel.
Note
To copy the pixel information string to the clipboard, right-click while the cursor is positioned over a pixel. In the context menu displayed, choose Copy pixel info.
Examples
This example displays an image and adds a pixel information tool to the figure. The example shows how you can change the position of the tool in the figure using properties of the tool uipanel object.
This example shows how the pixel information tool works in a figure containing multiple images of different types.
figure subplot(1,2,1), imshow('liftingbody.png'); subplot(1,2,2), imshow('autumn.tif'); impixelinfo;
See Also
impixelinfoval
, impixelregion
, imshow
, imtool
impixel | impixelinfoval |
© 1994-2005 The MathWorks, Inc.