ImageSegmenter.__call__

ImageSegmenter.__call__(image)[source]

This method attempts to segment images into foreground/background objects.

The objects are segmented by #. Performing a multi-level Otsu threshold on the image #. Choosing all but the bottom level from Otsu as likely foreground. #. Performing connected components on all the likely foreground objects #. Rejecting connected objects where the DN is less than the minimum_segment_dn #. Rejecting connected objects where the area is less than the minimum_segment_area

The resulting objects are returned as a label matrix, where values >=1 indicate a pixel containing a foreground object (values of 0 are the background object). In addition, the statistics about the foreground objects are returned.

Parameters:

image (ndarray[tuple[Any, ...], dtype[_ScalarT]]) – The image to attempt to segment

Returns:

A named tuple containing the label array, a boolean array specifying foreground objects, a stats array about the labels in order, and the centroids of the segments

Return type:

ImageSegmenterOut