SciPy

scipy.ndimage.measurements.watershed_ift

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

Apply watershed from markers using an iterative forest transform algorithm.

Parameters:

input : array_like

Input.

markers : array_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.

structure : structure 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.

out : ndarray

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

Returns:

watershed_ift : ndarray

Output. Same shape as input.