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|
To filter a region of interest (ROI), first define a mask to separate the ROI from the background, then apply the filter to the ROI only.
A binary mask classifies image pixels as belonging to either the region of interest or the background.
This example shows how to use masked filtering to increase the contrast of a specific region of an image.
This example shows how to define your own function and mask to filter a region of interest.
The process of filling a region of interest involves replacing all pixels in the region by interpolating inward from the boundary of the region.