This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


computes a property for all components in a label matrix m and returns a version of m in which components that do not satisfy crit are replaced with zeros.
gives a label matrix for the first n components, ranked by property .
uses an ordering function p.
  • SelectComponents[m, Large] selects components whose size is greater than a globally determined threshold.
  • SelectComponents also works with binary images, using the connectivity of nonzero pixels to compute the label matrix.
  • By default all eight pixels surrounding a pixel are treated as neighbors. Using the option setting CornerNeighbors->False treats only the four pixels in the coordinate directions as adjacent.
Select the outermost components in an image:
Select the outermost components in an image:
Click for copyable input
Deleting small components from a label matrix:
Delete small components from a binary image:
Select the three largest components:
Select long components in an image:
Selecting components based on multiple properties:
Select the four roundest objects:
Find objects smaller than 500 pixels that have holes and do not touch an image border:
Extracting segments belonging to numbers in an image of a calendar:
Find the river in a satellite image by selecting the longest component:
New in 8