A region of interest (ROI) is a portion of an image that you want to filter or perform some other operation on. You define an ROI by creating a binary mask, which is a binary image that is the same size as the image you want to process. In the mask image, the pixels that define the ROI are set to 1 and all other pixels set to 0.
You can define more than one ROI in an image. The regions can be geographic in nature, such as polygons that encompass contiguous pixels, or defined by a range of intensities. In the latter case, the pixels are not necessarily contiguous.
||Specify polygonal region of interest (ROI)|
||Convert region of interest (ROI) polygon to region mask|
||Fill in specified regions in image using inward interpolation|
||Select region of interest (ROI) based on color|
||Filter region of interest (ROI) in image|
Filtering a region of interest (ROI) is the process of applying a filter to a region in an image, where a binary mask defines the region.
This section describes how to create binary masks to define ROIs.
createMask method of ROI objects you can create a binary mask that defines an ROI associated with a particular image.
You can use the
roicolor function to define an ROI based on color or intensity range.
This example shows how to use masked filtering to increase the contrast of a specific region of an image.
This example shows how to filter a region of interest (ROI), using the roifilt2 function to specify the filter.
This example shows how to use
regionfill to fill a region of interest (ROI) in an image.