1.42k likes | 1.43k Views
This work explores the powerful segmentation operator of watershed transform and efficient flooding algorithms for grayscale image segmentation. Contributors: Michel Couprie, Gilles Bertrand, Laurent Najman.
E N D
Quasi-linear algorithms for the topological watershed Michel Couprie
Contributors to this work Gilles Bertrand Michel Couprie Laurent Najman
Watersheds • Powerful segmentation operator from the field of Mathematical Morphology • Introduced as a tool for segmenting grayscale images by S. Beucher, H. Digabel and C. Lantuejoul in the 70s • Efficient algorithms based on immersion simulation were proposed by L. Vincent, F. Meyer, P. Soille (and others) in the 90s
Meyer’s flooding algorithm Label the regional minima with different colors Repeat Select a pixel p, not colored, not watershed, adjacent to some colored pixels, and having the lowest possible gray level If p is adjacent to exactly one color then label p with this color If p is adjacent to more than one color then label p as watershed Until no such pixel exists
Flooding algorithm 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 5 1 1 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Flooding algorithm 3 3 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 1 20 3 3 3 3 1 20 3 3 5 5 5 10 10 10 1 10 1 15 20 1 3 3 3 3 1 20 3 3 5 5 30 30 30 10 1 15 15 1 20 3 3 3 3 1 20 3 3 5 30 20 20 20 30 1 15 15 1 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 10 1 1 10 10 5 1 5 5 5 10 40 20 40 10 10 1 1 5 5 5 0 1 1 1 3 5 10 1 15 20 1 15 10 5 1 1 1 0 1 1 1 0 1 1 3 5 10 15 20 15 10 5 1 0 1 1 0 1 1 3 5 10 15 20 15 10 5 1 0 1 1
Flooding algorithm 3 3 3 20 1 3 3 3 3 5 5 5 10 10 10 10 1 15 1 1 20 3 3 3 3 3 1 20 3 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 3 3 3 3 3 1 20 3 3 3 3 5 5 30 30 30 10 15 1 15 20 1 3 3 3 3 3 1 20 3 3 3 3 5 30 20 20 20 30 1 15 15 1 1 20 3 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 5 1 5 5 5 10 40 20 40 10 10 1 1 5 5 5 0 1 1 3 5 10 1 15 20 1 15 10 1 5 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Flooding algorithm 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 1 1 5 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Flooding algorithm 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 1 1 5 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Flooding algorithm 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 1 1 5 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Flooding algorithm 20 1 3 3 5 5 5 10 10 10 1 10 1 15 1 20 3 20 1 3 3 5 5 5 10 10 10 1 10 1 15 1 20 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 1 20 3 3 5 30 20 20 20 30 15 1 15 1 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 1 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 10 5 1 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 0 1 3 5 10 1 15 20 1 15 10 5 1 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Flooding algorithm 1 20 3 3 5 5 5 10 10 10 1 10 15 1 1 20 3 20 1 3 3 5 5 5 10 10 10 1 10 15 1 1 20 3 1 20 3 3 5 5 30 30 30 30 30 10 15 1 15 20 1 3 20 1 3 3 5 30 30 20 20 20 30 30 15 1 15 1 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 1 10 10 10 10 40 20 20 20 40 1 10 1 10 10 1 10 5 1 5 5 5 10 40 20 40 10 10 1 1 5 5 5 1 0 1 3 5 10 1 15 20 1 15 10 5 1 1 1 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
There is no descending path from the 20s to the minimum 3 The contrast between minima is not preserved Flooding algorithm 20 1 3 3 5 5 5 10 10 10 10 1 1 15 1 20 3 1 20 3 3 5 5 5 10 10 10 10 1 1 15 1 20 3 20 1 3 3 5 5 30 30 30 10 1 15 15 1 20 3 20 1 3 3 5 30 20 20 20 30 15 1 15 1 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 10 1 10 1 1 10 10 5 1 5 5 5 10 40 20 40 10 10 1 1 5 5 5 1 0 1 3 5 10 15 1 20 15 1 10 1 5 1 1 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Flooding algorithm • Efficient implementation thanks to a priority queue (non-monotonic) • Preserves the connectivity of the binary set constituted by the regional minima of the original image • Uses the graylevels as a « heuristics » to guide the propagation of the colors associated to the different minima
Discrete sets and W-destructible points Let (V,E) be a (undirected) graph andlet X be a subset of V.
Discrete sets and W-destructible points Let (V,E) be a (undirected) graph and let X be a subset of V. We say that a point x X is W-destructible for X if x is adjacent to exactly one connected component of X. M. Couprie and G. Bertrand (1997)
Topological watersheds • Let X and Y be two subsets of V. We say that Y is a W-thinning of X if Y may be obtained from X by iteratively removing W-destructible points. • Let X and Y be subsets of V. We say that Y is a watershed of X if Y is a W-thinning of X and if there is no W-destructible point for Y. M. Couprie and G. Bertrand (1997)
Discrete maps and W-destructible points • Let (V,E) be a connected (undirected) graph. We denote by F (V) the family composed of all maps from V to Z. • Let F F (V), we set Fk = {x V; F(x) k}, Fk is the cross-sectionof F at level k • Let x V and let k = F(x). We say that x is W-destructible (for F) if x is adjacent to exactly one connected component of Fk M. Couprie and G. Bertrand (1997)
W-destructible points 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 5 1 1 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
W-destructible points 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 5 1 1 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 1 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
F1 W-destructible points 20 1 3 3 5 5 5 10 10 10 10 1 1 15 1 20 3 20 1 3 3 5 5 5 10 10 10 1 10 1 15 20 1 3 1 20 3 3 5 5 30 30 30 10 15 1 15 20 1 3 1 20 3 3 5 30 20 20 20 30 1 15 1 15 1 20 3 40 40 40 40 40 20 20 20 40 40 40 40 40 1 10 10 10 10 40 20 20 20 40 10 1 10 1 10 1 10 1 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 0 1 3 5 10 15 1 20 15 1 10 1 5 1 1 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
W-destructible points 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 5 1 1 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 0 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Topological watershed • Let F and G be in F (V). • We say that G is a W-thinning of F if G may be obtained from F by iteratively lowering W-destructible points (by 1). • If G is a W-thinning of F which has been obtained by lowering a single point p (by 1 or by more than 1) we say that p has been W-lowered. • We say that G is a (topological) watershed of Fif G is a W-thinning of F and if there is no W-destructible point for G. M. Couprie and G. Bertrand (1997)
Topological watershed 20 1 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 1 20 3 3 5 5 5 10 10 10 10 1 15 1 20 1 3 20 1 3 3 5 5 30 30 30 10 15 1 15 1 20 3 20 1 3 3 5 30 20 20 20 30 1 15 1 15 20 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 10 1 10 10 10 40 20 20 20 40 1 10 1 10 1 10 10 1 5 5 5 5 10 40 20 40 10 10 5 1 1 5 5 0 1 1 3 5 10 15 1 20 15 1 10 1 5 1 0 0 1 1 0 1 3 5 10 15 20 15 10 5 1 0 1 0 1 3 5 10 15 20 15 10 5 1 0 1
Topological watershed 1 3 1 3 3 3 3 3 3 3 3 3 3 1 1 3 3 3 1 1 3 3 3 3 3 3 3 3 3 3 1 3 1 3 1 3 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 1 3 3 3 3 30 20 20 20 30 1 3 1 3 3 40 40 40 40 40 20 20 20 40 40 40 40 40 0 1 1 1 1 40 20 20 20 40 1 0 1 0 0 1 1 1 0 1 1 1 1 40 20 40 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 20 1 0 0 1 0 0 1 1 0 1 0 1 1 1 1 1 20 0 0 0 0 0 1 0 1 1 1 1 1 20 0 0 0 0 0 1
Topological watershed 1 3 1 3 3 3 3 3 3 3 3 3 3 1 1 3 3 3 1 1 3 3 3 3 3 3 3 3 3 3 1 3 1 3 1 3 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 1 3 3 3 3 30 20 20 20 30 1 3 1 3 3 40 40 40 40 40 20 20 20 40 40 40 40 40 0 1 1 1 1 40 20 20 20 40 1 0 1 0 0 1 1 1 0 1 1 1 1 40 20 40 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 20 1 0 0 1 0 0 1 1 0 1 0 1 1 1 1 1 20 0 0 0 0 0 1 0 1 1 1 1 1 20 0 0 0 0 0 1
F40 Topological watershed 1 3 1 3 3 3 3 3 3 3 3 3 3 1 1 3 3 3 1 1 3 3 3 3 3 3 3 3 3 3 1 3 1 3 1 3 3 3 3 3 3 30 30 30 3 1 3 3 3 3 1 1 3 3 3 3 30 20 20 20 30 3 1 3 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 0 1 1 1 1 40 20 20 20 40 1 0 1 0 1 0 1 0 1 1 1 1 1 40 20 40 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 20 1 0 0 0 1 1 0 0 1 1 0 1 1 1 1 1 20 0 0 0 0 0 1 0 1 1 1 1 1 20 0 0 0 0 0 1
Topological watershed 1 3 1 3 3 3 3 3 3 3 3 3 3 1 1 3 3 3 1 1 3 3 3 3 3 3 3 3 3 3 1 3 1 3 1 3 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 1 3 3 3 3 30 20 20 20 30 1 3 1 3 3 40 40 40 40 40 20 20 20 40 40 30 40 40 0 1 1 1 1 40 20 20 20 40 1 0 1 0 0 1 1 1 0 1 1 1 1 40 20 40 0 0 1 0 1 0 1 0 1 1 1 1 1 1 1 20 1 0 0 1 0 0 1 1 0 1 0 1 1 1 1 1 20 0 0 0 0 0 1 0 1 1 1 1 1 20 0 0 0 0 0 1