- •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
Watershed example
8 7 5 4 3
9 6 2 1 2
4 2 7 3 4
3 0 1 8 2
6 1 3 6 1
gradmag image
u u u u u u u u u u u u u u u u u u u u u u u u u
0:(1,3)
1:(3,1), (2,3), (1,4), (4,4)
2:(2,1), (4,1), (1,2), (4,3)
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9:(0,1)
pixel list |
Step 4: |
k=0 |
|
Expand frontier |
|||
|
|||
(no frontier yet)
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed example
8 7 5 4 3
9 6 2 1 2
4 2 7 3 4
3 0 1 8 2
6 1 3 6 1
gradmag image
u u u u u u u u u u u u u u u u 0 u u u u u u u u
0:(1,3)
1:(3,1), (2,3), (1,4), (4,4)
2:(2,1), (4,1), (1,2), (4,3)
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9:(0,1)
pixel list |
Step 5: |
k=0 |
|
Create new catchment |
|||
|
|||
basins
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed example
8 7 5 4 3
9 6 2 1 2
4 2 7 3 4
3 0
8 2
63 6 1
gradmag image
u u u u u u u u u u u u u u u u 0 0 u u u 0 u u u
(shaded pixels are on frontier)
0:(1,3)
1:(3,1),
(4,4)
2:(2,1), (4,1), (1,2), (4,3)
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9:(0,1)
pixel list |
Step 6: |
k=1 |
|
Grow catchment basins |
|||
|
|||
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed example
8 7 5 4 3
9 6 2 1 2
4 2 7 3 4
3 0
8 2
63 6 1
gradmag image
u u u u u u u u u u u u u u u u 0 0 u u u 0 u u u
(shaded pixels are on frontier)
0:(1,3)
1:(3,1),
(4,4)
2:(2,1), (4,1), (1,2), (4,3)
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9:(0,1)
pixel list |
Step 7: |
k=1 |
|
Expand frontier |
|||
|
|||
(nowhere to go)
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed example
8 7 5 4 3
9 6 2 1 2
4 2 7 3 4
3 0 1 8 2
6 1 3 6 1
gradmag image
u u u u u u u u 1 u u u u u u u 0 0 u u u 0 u u 2
0:(1,3)
1:(3,1), (2,3), (1,4), (4,4)
2:(2,1), (4,1), (1,2), (4,3)
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9:(0,1)
pixel list |
Step 8: |
k=1 |
|
Create new basins |
|||
|
|||
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed example
8 |
7 |
5 |
4 |
3 |
9 |
6 |
|
1 |
|
4 |
|
7 |
3 |
4 |
3 |
0 |
1 |
8 |
|
6 |
1 |
3 |
6 |
1 |
gradmag image
u u u u u u u 1 1 1 u 0 u u u u 0 0 u 2 u 0 u u 2
(shaded pixels are on frontier)
0:(1,3)
1:(3,1), (2,3), (1,4), (4,4)
2:
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9: (0,1) |
Step 9: |
k=2 |
|
pixel list |
|||
Grow basins |
|||
|
|||
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed example
8 |
7 |
5 |
4 |
3 |
9 |
6 |
|
1 |
|
4 |
|
7 |
3 |
4 |
3 |
0 |
1 |
8 |
|
6 |
1 |
3 |
6 |
1 |
gradmag image
u u u u u u u 1 1 1 u 0 u u u u 0 0 u 2 u 0 u u 2
(shaded pixels are on frontier)
0:(1,3)
1:(3,1), (2,3), (1,4), (4,4)
2:
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9: (0,1) |
Step 10: |
k=2 |
|
pixel list |
|||
Expand frontier |
|||
|
|||
(nowhere to go)
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Watershed example
8 7 5 4 3
9 6 2 1 2
4 2 7 3 4
3 0 1 8 2
6 1 3 6 1
gradmag image
u u u u u u u 1 1 1 u 0 u u u u 0 0 u 2 u 0 u u 2
0:(1,3)
1:(3,1), (2,3), (1,4), (4,4)
2:(2,1), (4,1), (1,2), (4,3)
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9:(0,1)
pixel list |
Step 11: |
k=2 |
|
Create new basins |
|||
|
|||
(none to create)
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
Fast forward…
Watershed example
8 7 5 4 3
9 6 2 1 2
4 2 7 3 4
3 0 1 8 2
6 1 3 6 1
gradmag image
0 0 1 1 1
0 0 1 1 1
0 0 0 1 1
0 0 0 0 2
0 0 0 0 2
0:(1,3)
1:(3,1), (2,3), (1,4), (4,4)
2:(2,1), (4,1), (1,2), (4,3)
3:(4,0), (3,2), (0,3), (2,4)
4:(3,0), (0,2), (4,2)
5:(2,0)
6:(1,1), (0,4), (3,4)
7:(1,0), (2,2)
8:(0,0), (3,3)
9:(0,1)
pixel list Final result
(but note that ties can be broken in other ways)
labels
S. Birchfield, Clemson Univ., ECE 847, http://www.ces.clemson.edu/~stb/ece847
