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.


Pixel Region tool

Use the impixelregion function to create a Pixel Region tool. The Pixel Region tool opens a separate figure window containing an extreme close-up view of a small region of pixels in the target image. For more information about using the tool, see Tips.


htool = impixelregion(___)


impixelregion creates a Pixel Region tool associated with the image displayed in the current figure, called the target image.

impixelregion(h) creates a Pixel Region tool in the figure specified by the handle h.

htool = impixelregion(___) returns htool, a handle of the Pixel Region tool figure.


Create Pixel Region Tool

Display an image and then create a Pixel Region tool associated with the image.

imshow peppers.png

Input Arguments

collapse all

Handle to a figure, axes, uipanel, or image graphics object, specified as a handle. If h is an axes or figure handle, impixelregion uses the first image returned by findobj(H,'Type','image').

Output Arguments

collapse all

Handle to Pixel Region tool figure, returned as a handle.


  • The Pixel Region rectangle defines the area of the target image that is displayed in the Pixel Region tool. You can move this rectangle over the target image using the mouse to view different regions. To get a closer view of the pixels displayed in the tool, use the zoom buttons on the Pixel Region tool toolbar or change the size of the Pixel Region rectangle using the mouse. You can also resize the Pixel Region tool itself to view more or fewer pixels. If the size of the pixels allows, the tool superimposes the numeric value of the pixel over each pixel.

  • To get the current position of the Pixel Region rectangle, right-click on the rectangle and select Copy Position from the context menu. The Pixel Region tool copies a four-element position vector to the clipboard. To change the color of the Pixel Region rectangle, right-click and select Set Color.

  • To create a Pixel Region tool that can be embedded in an existing figure window or uipanel, use impixelregionpanel.

Introduced before R2006a

Was this topic helpful?