Watershed¶
Watershed treats the image’s intensity (or a distance-transform of a binary mask) as a topographic surface, and “floods” it from a set of seed points (local minima, or user/algorithm-supplied markers). Each flood-fill spreads outward until it meets another region’s flood, building a boundary — a watershed line — exactly where two basins meet. Because the flooding is distance-transform-based, watershed is particularly effective at splitting touching or overlapping objects that a simple threshold would merge into one connected component.
Run to completion, watershed tends to over-segment noisy images (every tiny local minimum becomes its own basin); in practice it’s usually seeded with a small number of markers (e.g. from local maxima of a distance transform) rather than run on the raw intensity surface.
Accessible via spice.clustering.watershed_clustering().
See also
Morphological Operations — the distance-transform and morphology concepts watershed is built on
Felzenszwalb — a graph-based alternative for splitting distinct regions
Image Clustering — every other clustering algorithm