Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

watershed transform

Treating pixel value as elevation and flooding outward from local minima, building a dam wherever two basins would otherwise merge.

The watershed transform treats an image (often its gradient magnitude) as a topographic surface, with pixel value as elevation. Flooding begins at every local minimum (a catchment basin) and rises; whenever the rising water of two distinct basins would meet, a dam (the watershed line) is placed there instead of letting the two basins merge. The final dams form the segmentation boundaries -- a technique especially suited to separating touching objects a simple threshold would leave fused together.

Read the full section →
Graph settings

Calculator