This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

impixelinfo

Pixel Information tool

Use the impixelinfo function to create a Pixel Information tool. The Pixel Information tool displays information about the pixel in an image that the pointer is positioned over. If the figure contains multiple images, the tool displays pixel information for all the images. For more information about using the tool, see Tips.

Syntax

impixelinfo
impixelinfo(h)
impixelinfo(hparent,himage)
htool = impixelinfo(___)

Description

impixelinfo creates a Pixel Information tool in the current figure.

impixelinfo(h) creates a Pixel Information tool in the figure specified by the handle h.

impixelinfo(hparent,himage) creates a Pixel Information tool in hparent that provides information about the pixels in himage.

htool = impixelinfo(___) returns a handle to the Pixel Information tool uipanel.

Examples

Add Pixel Information Tool to Figure

Display an image and add 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.

h = imshow('hestain.png');
hp = impixelinfo;
set(hp,'Position',[5 1 300 20]);

Use the Pixel Information tool 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;

Input Arguments

collapse all

Handle to a figure, axes, uipanel, or image graphics object, specified as a handle. Axes, uipanel, or figure objects must contain at least one image object.

Handle to a figure or uipanel object that contains the Pixel Information tool, specified as a handle.

Handle to one or more images, specified as a handle or an array of image handles.

Output Arguments

collapse all

Handle to Pixel Information tool uipanel, returned as a handle.

Tips

The Pixel Information tool is a uipanel object, positioned in the lower-left corner of the figure. The tool contains the text label Pixel info: followed by the pixel information. Before you move the pointer over the image, the tool contains the default pixel information text (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 label for that image type.

Image Type

Pixel Information

Example

Intensity

(X,Y) Intensity

(13,30) 82

Indexed

(X,Y) <index> [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 <index> [R G B]

(19,10) 82 <4> [15 255 10]

  • If you want to display the pixel information without the “Pixel Info” label, use the impixelinfoval function.

  • To copy the pixel information label to the clipboard, right-click while the pointer is positioned over a pixel. In the context menu displayed, choose Copy pixel info.

Introduced before R2006a