Watershed Algorithm
The watershed algorithm (WA) is a segmentation algorithm commonly used in image processing. The WA is based on the Euclidean Distance Transform (EDT). Grain seeds are placed in the local maxima of the EDT, and in those seeds, grains start to “grow”. In the growing process, grain boundaries are formed as soon as grains touch.
The concept behind the watershed algorithm transform can be understood more easily in a 2D example. In this representation, the EDT can be regarded as a topographical relief where high values represent valleys and low values represent peaks. This topography is continuously “flooded with water”, starting from the deepest valleys. As soon as the water from neighboring valley begins to mix, a dam is created (corresponding to the grain boundary). The result is a topography with water-filled valleys and dams that separate them. The identified valleys represent the grains and the dams that separate them denote the grain boundaries.
In the figure below, the progression of the watershed algorithm is illustrated. On the left side, the topographical relief corresponding to the EDT is shown where the grain seeds (valley bottom) are marked in red. This topography is successively flooded with water, and dams are formed between adjacent valleys.
Known information about the grain space, i.e. the minimal grain diameter, can be used to adjust the results of the Watershed Algorithm.