This is documentation for an old release of SciPy (version 0.7.). Read this page in the documentation of the latest stable release (version 1.15.1).
Label an array of objects.
The structure that defines the object connections must be symmetric. If no structuring element is provided an element is generated with a squared connectivity equal to one. This function returns a tuple consisting of the array of labels and the number of objects found. If an output array is provided only the number of objects found is returned.