scipy.ndimage.watershed_ift

scipy.ndimage.watershed_ift(input, markers, structure=None, output=None)[source]

Apply watershed from markers using image foresting transform algorithm.

Parameters
inputarray_like

Input.

markersarray_like

Markers are points within each watershed that form the beginning of the process. Negative markers are considered background markers which are processed after the other markers.

structurestructure element, optional

A structuring element defining the connectivity of the object can be provided. If None, an element is generated with a squared connectivity equal to one.

outputndarray, optional

An output array can optionally be provided. The same shape as input.

Returns
watershed_iftndarray

Output. Same shape as input.

References

1

A.X. Falcao, J. Stolfi and R. de Alencar Lotufo, “The image foresting transform: theory, algorithms, and applications”, Pattern Analysis and Machine Intelligence, vol. 26, pp. 19-29, 2004.