
- •Segmentation
- •Watershed segmentation
- •Watershed algorithms
- •Vincent-Soille algorithm
- •Watershed
- •Traditional watershed uses dams
- •Watershed results
- •Watershed leads to oversegmentation
- •Markers solve this problem
- •Marker-based watershed
- •Simplified Vincent-Soilles
- •only needs to be done once initially (can use connected components)
- •Simplified Vincent-Soilles
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Watershed example
- •Fast forward…
- •Watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Marker-based watershed example
- •Fast forward…
- •Marker-based watershed example
- •Marker-based watershed
- •Why are ridges needed?
- •Another example
Segmentation
ECE 847: |
Stan Birchfield |
Digital Image Processing |
Clemson University |

Watershed segmentation
Interpret (gradient magnitude) image as topographical surface:
watershed line
catchment basin
All pixels in catchment basin are connected to minimum by monotonically decreasing path
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed algorithms
•Water immersion (Vincent-Soille)
–Puncture hole at each local minimum, immerse in water
–Grow level by level, starting with dark pixels
–Sorting step: For efficiency, precompute for each graylevel a list of pixels with that graylevel (histogram with pointers)
–Flooding step: Then, repeat:
•Breadth-first search (floodfill) of level g given flooding up to level g-1
•For each pixel with value g, either assign to closest catchment basin or declare new catchment basin (geodesic influence zone)
•Tobogganing
–Find downstream path from each pixel to local minimum
–Difficult to define for discrete (quantized) images because of plateaus
S.Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847

Vincent-Soille algorithm
new basin created
≤ g-1
g
multiple basins
extended: decision chosen by breadth-first search
basin extended
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847

Watershed
from Gonzalez and Woods, Digital Image Processing

Traditional watershed uses dams
(But our implementation does not need dams)

Watershed results
(But the results from our implementation will be better than this)
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847

Watershed leads to oversegmentation
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847

Markers solve this problem
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Marker-based watershed
•Threshold image
•Compute chamfer distance
•Run watershed to get lines between objects
•Set these lines (skeletons) and blobs to zero in
the gradient magnitude image
for each x, y:
grad(x,y) = max( grad(x,y), 1 ) if marker(x,y), grad(x,y) = 0
(Alternatively, use separate gradient and marker images)
•Only allow new basins where the value is zero
S.Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847