FUNCTION REFERENCE
bwpropfilt
Keep binary objects by a scalar region property.
Keep binary objects by a scalar region property.
Syntax
BW2 = bwpropfilt(BW, attrib, range, conn)Syntax
BW2 = bwpropfilt(BW, attrib, n, keep, conn)Syntax
BW2 = bwpropfilt(BW, I, attrib, range, conn)Uses existing scalar regionprops properties: Area, Extent, EquivDiameter, FilledArea, MajorAxisLength, MinorAxisLength, Eccentricity, Orientation, Perimeter, MeanIntensity, MinIntensity and MaxIntensity. I is required for intensity properties. range is inclusive; n keeps the largest objects by default. Optional keep ('largest' or 'smallest') and conn (4 or 8, default 8) follow the selection. Ties retain the first n in column-major component order. BW and output are logical.
Example
bwpropfilt(logical([1 0 1 1; 0 0 1 1]),'Area',[2 5])Differences from MATLAB: only scalar properties implemented by regionprops; no connected-component struct input or custom connectivity.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.