The over-segmentation problem: A raw gradient image of tissue might have hundreds of local minima — every small dip in intensity creates a catchment basin. Solomon & Breckon describe this as "noise and small-scale structures result in many local, small catchment basins (broadly analogous to puddles on the landscape)." These "puddles" produce hundreds of tiny regions where you expected only a few objects.
The marker-controlled solution: Instead of using every natural minimum, you pre-define seed points — one per expected object. The algorithm modifies the image so that only these seeds are minima, then floods as before. This is a five-step recipe: (1) compute gradient magnitude, (2) find foreground markers via morphological operations, (3) find background markers, (4) modify the gradient to have minima only at markers, (5) compute watershed on the modified gradient.
Mathematical guarantee: Watershed boundaries are always closed contours. This is a topological necessity — if a boundary were open, water from adjacent basins could flow through the gap and merge, contradicting the algorithm's construction. This guarantee is valuable because edge detection methods (Sobel, Canny) often produce broken contours that require additional linking steps.
The distance transform connection: When the input is a distance transform rather than an intensity image, watershed performs shape-based segmentation. Each object's skeleton becomes a ridge in the distance transform, and the watershed boundaries follow these ridges. This is how StrataQuest separates touching objects that have similar intensities — by segmenting based on shape rather than brightness.
Computational note: The flooding algorithm processes each pixel exactly once (each pixel is examined when the water level reaches its intensity). For an image with L intensity levels and N pixels, the time complexity is O(N log L) — efficient enough for large tissue images.
The main challenge with watershed is over-segmentation — every small dip in intensity creates its own region, like puddles forming everywhere in a landscape. The solution is to place "seed" markers where you expect objects and modify the image so that only those seeds create basins. The mathematical beauty of watershed is that its boundaries are always complete, closed curves — no gaps or breaks — which edge detection methods cannot guarantee.