impixelinfo() - Image Processing
impixelinfo creates a Pixel
Information tool in the current figure. The Pixel Information tool
displays information about the pixel in an image that the pointer
is positioned over. The tool can display pixel information for all
the images in a figure.The Pixel Information tool is a uipanel object, positioned in
the lower-left corner of the figure. The tool contains the text string Pixel
info: followed by the pixel information. Before you move
the pointer over the image, the tool contains the default pixel information
text string (X,Y) Pixel Value. Once you move the
pointer over the image, the information displayed varies by image
type, as shown in the following table. If you move the pointer off
the image, the pixel information tool displays the default pixel information
string for that image type.Image Type Pixel
Information Example
Intensity(X,Y) Intensity(13,30) 82
Indexed(X,Y) [R G B](2,6) <4> [0.29 0.05 0.32]
Binary(X,Y) BW(12,1) 0
Truecolor(X,Y) [R G B](19,10) [15 255 10]
Floating point image with CDataMapping property
set to direct(X,Y) value [R G B](19,10) 82 <4> [15 255 10]
For example, for grayscale (intensity) images, the pixel information
tool displays the x and y coordinates
of the pixel and its value, as shown in the following figure.
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.
Syntax
impixelinfoimpixelinfo(h)impixelinfo(hparent,himage)hpanel = impixelinfo(...)
Example
h = imshow('hestain.png');
hp = impixelinfo;
set(hp,'Position',[5 1 300 20]);
Output / Return Value
Limitations
Alternatives / See Also
Reference