SelectComponents 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.
SelectComponents gives a label matrix for the first n components, ranked by property .
SelectComponents returns a label matrix for the last n components.
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.