regionprops() - Image Processing
stats = regionprops(BW,properties) returns
measurements for the set of properties specified by properties for
each connected component (object) in the binary image, BW. stats is
struct array containing a struct for each object in the image. You
can use regionprops on contiguous regions and discontiguous
regions (see Algorithms). stats = regionprops(CC,properties) returns
measurements for the set of properties specified by properties for
each connected component (object) in CC. CC is
a structure returned by bwconncomp.stats = regionprops(L,properties) returns
measurements for the set of properties specified by properties for
each labeled region in the label matrix L. stats = regionprops(___,I,properties) returns
measurements for the set of properties specified by properties for
each labeled region in the image I. The first input
to regionprops (BW, CC,
or L) identifies the regions in I.
The size of the first input must match the size of the image, that
is, size(I) must equal size(BW), CC.ImageSize,
or size(L). examplestats = regionprops(output,___) returns
measurements for a set of properties, where output specifies
the type of return value. regionprops can return
these values in a struct or a table.examplestats = regionprops(gpuarrayImg,___) performs
the measurements on a GPU. gpuarrayImg can be
a 2-D binary image (logical gpuArray) or a gpuArray
label matrix. The connected component structure (CC)
returned by bwconncomp is not supported on the
GPU.When run on a GPU, regionprops does not support
the following properties: 'ConvexArea', 'ConvexHull', 'ConvexImage', 'EulerNumber', 'FilledArea', 'FilledImage',
and'Solidity'.Code Generation support:
Yes.MATLABĀ® Function Block support: No.
Syntax
stats = regionprops(BW,properties) examplestats = regionprops(CC,properties)stats = regionprops(L,properties)stats = regionprops(___,I,properties)stats = regionprops(output,___) examplestats = regionprops(gpuarrayImg,___) example
Example
cc = bwconncomp(BW);
stats = regionprops(cc, 'Area','Eccentricity');
idx = find([stats.Area] > 80 & [stats.Eccentricity] < 0.8);
BW2 = ismember(labelmatrix(cc), idx);
Output / Return Value
Limitations
Alternatives / See Also
Reference