impixelregion

Pixel Region tool

Use the impixelregion function to create a Pixel Region tool in a new figure window. The Pixel Region tool is an aid to explore pixel values of images.

The Pixel Region tool displays an extreme close-up view of a small region of pixels in the target image. The tool overlays a rectangle, called the pixel region rectangle, over the target image. To view pixels in a different region, click and drag the rectangle over the target image, or scroll the Pixel Region tool. You can resize the pixel region rectangle to change the resolution of pixels in the Pixel Region tool. If the size of the pixels allows, the tool superimposes the numeric value of the pixel over each pixel.

Syntax

impixelregion
impixelregion(h)
htool = impixelregion(___)

Description

example

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 to the Pixel Region tool figure.

Examples

collapse all

Display an image.

imshow('peppers.png')

Create an pixel region tool in a new figure window. The tool associates with the image in the current figure.

impixelregion

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.

Tips

  • To get a closer view of the pixels displayed in the tool, use the zoom buttons on the Pixel Region tool toolbar.

  • 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