Pixel Region tool panel
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.
creates a Pixel Region tool in a figure window.
hpanel = impixelregionpanel(
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.
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.
set(hpanel,'Position',[0.55 0.3 .4 .4])
hparent — Handle to figure or uipanel object
Handle to a figure or uipanel object that will contain the Pixel Region tool, specified as a handle.
himage — Handle to target image
Handle to target image, specified as a handle.
hpanel — Handle to Pixel Region tool
Handle to Pixel Region tool, returned as a handle. A Pixel Region tool is a type of uipanel object.
To create a Pixel Region tool in a separate figure window, use
Introduced before R2006a