Image subregions may be conveniently specified by using Mathematica Graphics primitives, such as
Circle,
Disk,
Point,
Line,
Rectangle,
Polygon, or simply as a list of vertex positions. We follow with a few demonstrations.
Point operations are mapped to every point in a ROI by using the function RegionPoints, which returns a list of all coordinate pairs within a region, given a region specification. Here is an example of using
RegionPoints to extract all diagonal elements of a matrix.
This shows the result of applying a Sobel edge detector to the region defined by
roi.
The function LineProfile is useful in obtaining details of amplitude variations (i.e., intensity profile) in an image by returning pixel values along some arbitrary user-selected path. Examples of row or column profiles were shown in Sections
2.2 and
2.5.