impixelregionpanel

Syntax

Description

Use the impixelregionpanel function to add a Pixel Region
tool to the same figure as an image. 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.

hpanel = impixelregionpanel(hparent,himage)
creates a Pixel Region tool in a figure window. himage is a
handle to the target image whose pixels are to be displayed.
hparent is the handle to the figure or uipanel object that
will contain the Pixel Region tool. hpanel is the handle to the
Pixel Region tool.

Examples

Add Pixel Region Tool to Figure

Display an image in a figure. This example displays the image in a subplot to create space in the figure window for the pixel region tool.

hFig = figure;
subplot(1,2,1)
hIm = imshow('peppers.png');

Create a pixel region tool in the same figure as the image. The pixel region tool covers the entire figure window.

hpanel = impixelregionpanel(hFig,hIm);

Reduce the dimensions of the pixel region tool to 40% of the height and width of the figure. Specify the position of the bottom left corner of the tool so that the tool occupies the space in the figure to the right of the image.

To explore pixel values across the image, try dragging and resizing the pixel region rectangle over the target image and scrolling the pixel region tool.

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.