Presentation is loading. Please wait.

Presentation is loading. Please wait.

Quasi-linear algorithms for the topological watershed

Similar presentations


Presentation on theme: "Quasi-linear algorithms for the topological watershed"— Presentation transcript:

1 Quasi-linear algorithms for the topological watershed
Michel Couprie

2 Contributors to this work
Gilles Bertrand Michel Couprie Laurent Najman

3 Prelude

4 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

5 Watershed transform

6 Flooding paradigm

7 Flooding paradigm

8 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

9 Flooding algorithm 3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

10 Flooding algorithm 3 3 3 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 20 1 3 3 3 3 3 3 5 5 5 10 10 10 10 1 15 1 20 1 1 20 3 3 3 3 3 3 5 5 30 30 30 10 1 15 15 20 1 1 20 3 3 3 3 3 3 5 30 20 20 20 30 15 1 1 15 20 1 20 1 40 40 40 40 40 20 20 20 40 40 40 40 40 10 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 5 5 1 5 1 1 1 1 1 3 5 10 1 15 20 1 15 10 5 1 1 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 1 1 3 5 10 15 20 15 10 5 1

11 Flooding algorithm 3 3 3 3 3 3 3 3 3 5 5 5 10 10 10 10 1 15 1 1 20 20 1 3 3 3 3 3 3 3 3 3 5 5 5 10 10 10 10 1 15 1 20 1 20 1 3 3 3 3 3 3 3 3 3 5 5 30 30 30 10 15 1 15 1 20 20 1 3 3 3 3 3 3 3 3 3 5 30 20 20 20 30 15 1 15 1 1 20 20 1 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 10 1 10 1 1 10 10 1 5 5 5 5 10 40 20 40 10 10 1 5 1 5 1 5 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

12 Flooding algorithm 3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

13 Flooding algorithm 3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

14 Flooding algorithm 3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

15 Flooding algorithm 3 3 3 5 5 5 10 10 10 10 1 15 1 1 20 20 1 3 3 3 5 5 5 10 10 10 10 1 15 1 20 1 20 1 3 3 3 5 5 30 30 30 10 1 15 15 20 1 1 20 3 3 3 5 30 20 20 20 30 15 1 1 15 1 20 20 1 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 10 1 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 5 1 5 1 1 1 3 5 10 15 1 20 1 15 10 1 5 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

16 Flooding algorithm 3 3 3 5 5 5 10 10 10 10 1 1 15 1 20 20 1 3 3 3 5 5 5 10 10 10 1 10 15 1 20 1 1 20 3 3 3 5 5 30 30 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 30 20 20 20 30 30 1 15 15 1 20 1 20 1 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 10 1 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 5 1 5 1 5 1 1 1 3 5 10 1 15 20 15 1 10 1 5 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

17 Flooding algorithm 3 3 3 5 5 5 10 10 10 10 1 1 15 20 1 20 1 3 3 3 5 5 5 10 10 10 10 1 15 1 20 1 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 15 1 1 15 1 20 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 10 1 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 1 15 20 15 1 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1 There is no descending path from the 20s to the minimum 3 The contrast between minima is not preserved

18 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

19 Topological watershed

20 Discrete sets and W-destructible points
Let (V,E) be a (undirected) graph and let X be a subset of V.

21

22 Graph

23 Graph

24 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)

25 W-destructible point

26 Non W-destructible point

27 W-destructible point

28 W-destructible point

29 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)

30

31 W-thinning

32 W-thinning

33 W-thinning

34 W-thinning

35 W-thinning

36 W-thinning

37 Watershed

38 Watershed 1

39 Watershed 2

40 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-section of 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)

41 W-destructible points
3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

42 W-destructible points
3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

43 W-destructible points
3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1 F1

44 W-destructible points
3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

45 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 F if G is a W-thinning of F and if there is no W-destructible point for G. M. Couprie and G. Bertrand (1997)

46 Topological watershed
3 3 3 5 5 5 10 10 10 1 10 15 1 1 20 1 20 3 3 3 5 5 5 10 10 10 1 10 1 15 1 20 1 20 3 3 3 5 5 30 30 30 10 15 1 15 20 1 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 20 1 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 1 10 10 1 1 10 1 10 5 5 5 5 10 40 20 40 10 10 1 5 1 5 5 1 1 1 3 5 10 15 1 20 1 15 10 5 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1

47 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 1 3 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

48 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 1 3 1 3 40 40 40 40 40 20 20 20 40 40 40 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

49 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 3 1 3 1 40 40 40 40 40 20 20 20 40 40 40 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20 F40

50 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 1 3 1 3 40 40 40 40 40 20 20 20 40 40 30 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

51 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 3 1 3 1 40 40 40 40 40 20 20 20 40 40 30 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20 F30

52 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 1 3 1 3 40 40 40 40 40 20 20 20 40 40 30 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

53 Topological watershed
3 1 30 30 30 30 20 20 20 30 40 40 40 40 40 20 20 20 40 40 30 40 40 1 40 20 20 1 20 40 40 20 40 20 20 20 F20

54 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 3 1 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 20 30 3 1 3 1 3 1 1 3 40 40 40 40 40 40 40 30 40 40 1 1 1 1 40 40 1 1 1 1 1 1 1 1 1 40 40 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

55 Topological watershed
3 20 1 3 3 3 3 3 3 3 3 3 1 3 3 1 3 1 3 1 3 3 3 3 3 3 3 3 3 3 1 3 1 1 3 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 30 3 1 1 3 3 1 3 1 40 40 40 40 40 40 40 30 40 40 1 1 1 1 40 40 1 1 1 1 1 1 1 1 1 40 40 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 F30

56 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 1 3 1 3 40 40 40 40 40 20 20 20 40 40 30 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

57 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 3 1 3 1 40 40 40 40 40 20 20 20 40 40 40 40 40 1 1 1 1 40 20 20 20 40 1 1 1 1 1 1 1 1 1 40 20 40 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20 F40

58 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 3 1 3 1 40 40 40 40 40 20 20 20 40 40 40 40 40 1 1 1 1 30 20 20 20 30 1 1 1 1 1 1 1 1 1 30 20 30 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20 F30

59 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 3 1 3 1 40 40 40 40 40 20 20 20 40 40 40 40 40 1 1 1 1 20 20 20 20 20 1 1 1 1 1 1 1 1 1 20 20 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20 F20

60 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 3 3 3 3 30 20 20 20 30 1 3 3 1 1 3 1 3 40 40 40 40 40 20 20 20 40 40 30 40 40 1 1 1 1 1 20 20 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

61 Topological watershed
3 3 3 3 3 3 3 3 3 3 1 1 3 3 1 3 1 3 3 3 3 3 3 3 3 3 3 1 3 1 1 3 3 1 3 3 3 3 3 30 30 30 3 1 3 3 3 1 3 3 3 3 3 30 20 20 20 30 3 1 3 1 1 3 1 3 40 40 40 40 40 20 20 20 40 40 30 40 40 1 1 1 1 1 20 20 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

62 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 3 1 3 3 3 3 3 3 3 3 3 1 3 3 1 3 1 3 1 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 1 20 30 3 1 3 1 1 3 1 3 30 30 30 30 1 1 20 30 30 30 30 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20

63 Topological watershed
3 3 3 3 3 3 3 3 3 1 3 3 1 1 3 1 3 3 3 3 3 3 3 3 3 3 3 1 3 1 3 1 1 3 3 3 3 3 3 30 30 30 3 3 1 3 3 1 3 3 3 3 3 30 1 20 30 3 1 1 3 3 1 3 1 30 30 30 30 1 1 20 30 30 30 30 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 20 The watershed is located on the crest lines of the original image The contrast between minima is preserved

64 W-thinning paradigm

65 Algorithms

66 Naive watershed algorithm
Repeat For each point p in V n If p is W-destructible n2 F(p) = F(p)-1 Until stability g.n2

67 How can we reduce the complexity ?
Two fundamental ideas: 1/ Find a characterization of W-destructible points which can be checked in constant time 2/ Find strategies which guarantee that each point is examined at most once

68 Different types of points (1)
9 1 8 6 5 7 2 3 Separating point (crest) A point p is separating for F if it is adjacent to at least two connected components of Fk, with k = F(p)

69 Different types of points (2)
9 1 8 6 5 7 2 3 Inner point, minimal (flat) A point p is an inner point for F if it is not adjacent to any connected component of Fk , with k = F(p) A point p is a minimal point for F if it belongs to a regional minimum of F

70 Different types of points (3)
9 1 8 6 5 7 2 3 Inner point, non minimal (flat) A point p is an inner point for F if it is not adjacent to any connected component of Fk , with k = F(p) A point p is a minimal point for F if it belongs to a regional minimum of F

71 Different types of points (4)
9 1 8 6 5 7 2 3 Pre-separating point (crest) A point p is pre-separating for F if it is W-destructible and if there is a value v such that W-lowering p until v makes p be a separating point

72 Different types of points (5)
9 1 8 6 5 7 2 3 Pre-inner point, M-destructible (flat) A point p is pre-inner for F if it is W-destructible and if there is a value v such that W-lowering p until v makes p be an inner point A point p is M-destructible for F if it is pre-inner and it may become a minimal point after W-lowering

73 Different types of points (6)
9 1 8 6 5 7 2 3 Pre-inner point, non M-destructible (flat) A point p is pre-inner for F if it is W-destructible and if there is a value v such that W-lowering p until v makes p be an inner point A point p is M-destructible for F if it is pre-inner and it may become a minimal point after W-lowering

74 Classification of points
crest flat W-destructible separating pre-separating pre-inner inner M-destructible non-M-destructible pre-inner minimal non-minimal inner

75 Transitions (1) 9 1 8 6 5 7 2 3 5 pre-separating separating

76 pre-inner, M-destructible
Transitions (2) 9 1 8 6 5 7 2 3 pre-inner, M-destructible inner, minimal

77 pre-inner, non M-destructible
Transitions (3) 9 1 8 6 5 7 2 3 8 pre-inner, non M-destructible inner, non minimal

78 Transitions (4) 9 1 8 6 5 7 2 3 pre-separating separating

79 pre-inner, M-destructible
Transitions (5) 9 1 8 6 5 7 2 3 2 pre-inner, M-destructible pre-separating

80 pre-inner, M-destructible
Transitions (6) 9 1 8 6 5 7 2 3 pre-inner, M-destructible separating

81 Transitions (7) pre-inner, non M-destructible
9 1 8 6 5 7 2 3 1 pre-inner, non M-destructible pre-inner, M-destructible

82 pre-inner, non M-destructible
Transitions (8) 9 1 8 6 5 7 2 3 2 pre-inner, non M-destructible pre-separating

83 pre-inner, non M-destructible
Transitions (9) 9 1 8 6 5 7 2 3 pre-inner, non M-destructible separating

84 pre-inner, non M-destructible
Transitions (10) 9 1 8 6 5 7 2 3 7 inner, non minimal pre-inner, non M-destructible

85 pre-inner, M-destructible
Transitions (11) 9 1 8 6 5 7 2 3 2 inner, non minimal pre-inner, M-destructible

86 Classification of transitions
Theorem: the only possible transitions for a point during a W-thinning are the 11 following ones: crest separating pre-separating pre-inner, non M-destructible pre-inner, M-destructible inner, non minimal inner, minimal

87 Pass value Let F be in F (V). If п is a path, we set F(п) = Max{F(x); x  п}. Let x, y in V We set F(x,y) = Min {F(п); п  п(x,y)}, F(x,y) is the pass value between x and y. Let X and Y be two subsets of V. We set F(X,Y) = Min{F(x,y); x  X and y  Y}.

88 Pass value F(x,y) = 20 40 40 40 40 40 40 40 40 40 40 40 40 40 40 1 1 2 3 10 5 25 5 4 4 4 40 x y 40 1 2 8 6 5 5 20 3 2 3 40 40 3 3 2 3 10 6 6 6 22 2 3 40 40 6 6 40 6 11 11 11 25 4 4 4 40 40 40 35 10 30 15 15 15 35 31 36 10 40 40 10 8 5 10 32 33 34 10 10 15 38 40 40 8 5 1 1 15 40 10 6 3 15 20 40 40 10 8 5 10 15 35 15 6 6 15 35 40 40 40 40 40 40 40 40 40 40 40 40 40 40

89 Separation Let F be in F (V) and let x and y be in V. We say that x and y are separated (for F) if F(x,y) > Max{F(x),F(y)}. We say that x and y are k-separated (for F) if x and y are separated and F(x,y) = k. Let F and G be in F (V) such that G  F. We say that G is a separation of F if, for all x,y in V, if x and y are k-separated for F, then x and y are k-separated for G.

90 k-separation y x x and y are 20-separated 40 40 40 40 40 40 40 40 40
1 1 2 3 10 5 25 5 4 4 4 40 x y 40 1 2 8 6 5 5 20 3 2 3 40 40 3 3 2 3 10 6 6 6 22 2 3 40 40 6 6 40 6 11 11 11 25 4 4 4 40 40 40 35 10 30 15 15 15 35 31 36 10 40 40 10 8 5 10 32 33 34 10 10 15 38 40 40 8 5 1 1 15 40 10 6 3 15 20 40 40 10 8 5 10 15 35 15 6 6 15 35 40 40 40 40 40 40 40 40 40 40 40 40 40 40

91 x and y are NOT separated (they are linked)
k-separation F(x,y) = 35 = F(y) x and y are NOT separated (they are linked) 40 40 40 40 40 40 40 40 40 40 40 40 40 40 1 1 2 3 10 5 25 5 4 4 4 40 40 1 2 8 6 5 5 20 3 2 3 40 x y 40 3 3 2 3 10 6 6 6 22 2 3 40 40 6 6 40 6 11 11 11 25 4 4 4 40 40 40 35 10 30 15 15 15 35 31 36 10 40 40 10 8 5 10 32 33 34 10 10 15 38 40 40 8 5 1 1 15 40 10 6 3 15 20 40 40 10 8 5 10 15 35 15 6 6 15 35 40 40 40 40 40 40 40 40 40 40 40 40 40 40

92 Theorem (strong separation)
Let F and G be in F (V) such that G  F. The map G is a strong separation of F if and only if G is a W-thinning of F. G. Bertrand (2003)

93 Property (characterization of W-destructible points)
Let F be in F (V), let p be in V. We denote by N-(p) the set of points adjacent to p and with a strictly lower altitude (lower neighbours). The point p is W-destructible for F if and only if N-(p) is not empty and for all x,y in N-(p), we have F(x,y) < F(p).

94 Illustration x y F(x,y) = 20 3 3 3 5 5 5 10 10 10 1 10 1 15 20 1 1 20
30 30 30 10 1 15 15 20 1 20 1 3 3 3 5 30 20 20 20 30 1 15 1 15 1 20 20 1 40 40 40 40 40 20 20 20 40 40 40 40 40 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 5 1 1 5 5 1 1 1 3 5 10 15 20 15 10 1 5 1 1 1 1 1 1 3 5 10 x 15 20 15 y 10 5 1 1 1 3 5 10 15 20 15 10 5 1 F(x,y) = 20

95 Illustration 3 3 3 5 5 5 10 10 10 10 1 1 15 20 1 1 20 3 3 3 5 5 5 10 10 10 10 1 15 1 20 1 1 20 3 3 3 5 5 30 30 30 10 1 15 15 1 20 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 1 20 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 10 1 1 10 10 1 10 1 5 5 5 5 10 40 20 40 10 10 5 1 5 1 1 5 1 1 3 5 10 1 15 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1 F(x,y) = 20

96 Illustration 3 3 3 5 5 5 10 10 10 10 1 1 15 20 1 1 20 3 3 3 5 5 5 10 10 10 10 1 15 1 20 1 1 20 3 3 3 5 5 30 30 30 10 1 15 15 1 20 1 20 3 3 3 5 30 20 20 20 30 1 15 1 15 1 20 1 20 40 40 40 40 40 20 20 20 40 40 40 40 40 10 10 10 10 40 20 20 20 40 10 1 1 10 10 1 10 1 5 5 5 5 10 40 20 40 10 10 5 1 5 1 1 5 1 1 3 5 10 1 15 20 1 15 10 5 1 1 1 1 1 1 1 3 5 10 15 20 15 10 5 1 1 1 3 5 10 15 20 15 10 5 1 F(x,y) = 10

97 W-destructible point Definition: involves all the connected components of a lower cross-section Chacterization: involves all the paths between the lower neighbors of the point What have we gained ?

98 Cross-sections, components
k Fk = {x E, F(x) < k}

99 Component tree Components + inclusion relation  tree structure

100 Component mapping

101 Illustration 3,g 1,b T 4,i 1,a F 3,g 3,h 2,f 2,c 2,d 2,e 2,f 1,a 1,b 
3,g 3 1,b T 4,i 1,a 2 3 3 3 3 F 3,g 3,h 3 1 2,f 1 3 3 1 3 3 2,c 2,d 2,e 2,f c c c c i b b b b 1,a 1,b a a a i g i b b b a a i g g g i b b a i f i g i e i b a a i a g b g b b a a a a g b b b b

102 Property For any weighted graph F, the component tree of F and the component mapping of F can be computed in quasi-linear time, more precisely, in O(n  e(n)) where n = |V| and e(n) is a function which grows extremely slowly with n. This result can be obtained thanks to the Tarjan’s Union-Find algorithm for the merging of disjoint sets. Tarjan, 1984 Najman and Couprie, 2004

103 (proper lca: different from both A and B)
Least common ancestor lca(A,B) A B (proper lca: different from both A and B)

104 Least common ancestor E lca(E,F) F (not a proper lca)

105 Property Any tree T can be represented in such a way that for any two nodes A, B of T, it is possible to find the least common ancestor of A and B in constant time (with a linear time pre-processing). Harel and Tarjan, 1984 Bender and Farach-Colton, 2000

106 Least common ancestor 1 2 3 4 5 6 1 11 15 33 32 2 10 12 14 16 3 5 9 25 31 17 13 18 22 24 28 30 26 6 8 4 19 21 23 27 29 7 20

107 Highest fork Let T be a tree, let S be a set of n nodes of T.
For any pair (A,B) of nodes in S, take the proper least common ancestor of A and B if it exists. The highest one among these ancestors (if it exists) is called the highest fork of S.

108 Highest fork B A C D hfork(A,B,C,D)

109 No highest fork for (A,B,D)

110 Property Let T be a tree, let S be a set of n nodes of T.
The highest fork of the nodes in S (or an indicator saying that no highest fork exists) can be computed by n -1 binary least common ancestor queries.

111 Property Let F be in F (V), let p,q be in V.
Let T be the component tree of F and let  be the component mapping of F. The points p,q are k-separated if and only if the nodes (p) and (q) have a highest fork H in T, and if H has the level k+1. The points p,q are linked if and only if the nodes (p) and (q) have no highest fork in T.

112 Corollary (characterization of W-destructible points)
Let F be in F (V), let p be in V. Let T be the component tree of F and let  be the component mapping of F. Thanks to T and , it is possible to check whether p is W-destructible or not in constant time. It is also possible to know in constant time the type of p and the lowest value v such that p can be W-lowered down to v.

113 Illustration 1 Highest fork = 3,g Not W-destructible T 4,i F 3,g 3,h
2 1 3 T 4,i 3 3 3 2 2 3 F 3,g 3,h 3 1 3 2 1 3 1 3 3 2 2 2 2,c 2,d 2,e 1,b 2,e 2,f 2 c c c c i b b b b 1,a 1,b a a a i g i b b b Highest fork = 3,g a a i g g g i b b a i f i g i e i b Not W-destructible a a i a g b g b b a a a a g b b b b

114 Illustration 2 Highest fork = 3,g W-destructible Lowest value = 2 T
1 1 1 2 1 3 T 4,i 3 1 2 3 3 2 2 3 3 F 3,g 3,g 2,e 1,b 3,h 3 1 3 2 3 1 3 3 2 2 2,c 2,d 2,e 2,f 2 c c c c i b b b b 1,a 1,b a a a i g i b b b Highest fork = 3,g a a i g g g i b b a i f i g i e i b W-destructible a a i a g b g b b Lowest value = 2 a a a a g b b b b

115 Illustration 3 No highest fork W-destructible Lowest value = 0 T 4,i F
1 1 1 2 1 2 1 3 T 4,i 3 3 3 3 2 2 3 F 3,g 2,c 1,a 3,g 3,h 3 1 3 2 3 1 3 3 2 2 2,c 2,d 2,e 2,f 2 c c c c i b b b b 1,a 1,b a a a i g i b b b No highest fork a a i g g g i b b a i f i g i e i b W-destructible a a i a g b g b b Lowest value = 0 a a a a g b b b b

116 How can we reduce the complexity ?
Two fundamental ideas: 1/ Find a characterization of W-destructible points which can be checked in constant time 2/ Find strategies which guarantee that each point is examined at most once

117 W-thinning algorithm The outline of a W-thinning algorithm is: Repeat until stability Select a W-destructible point p, according to a certain criterion Lower the value of p In order to ensure a linear time complexity, we must avoid multiple selections of the same point.

118 W-thinning algorithm

119 M-thinning Recall that a point p is M-destructible for F if it is W-destructible for F and if it may become a minimal point after W-lowering. If an M-destructible point p is W-lowered down to the value of an adjacent minimum, then we say that p is M-lowered. Obviously, a minimal point will never become W-destructible in further steps of a W-thinning process (recall the transition graph).

120 M-thinning Let F, G in F(V).
We say that G is an M-thinning of F if G may be obtained from F by iteratively M-lowering some M-destructible points. We say that G is an M-watershed of F if G is an M-thinning of F and if G has no M-destructible point.

121 Property Let F in F(V), let G be a an M-watershed of F.
Any W-thinning of G has exactly the same regional minima as G.

122 Illustration Minima ( , , ) Crest ( , , ) Other ( , ) 9 3 9 3 2 3 1 9
3 9 3 2 3 1 9 4 3 1 9 5 4 7 7 1 1 9 7 2 2 1 1 9 2 2 2 Minima ( , , ) 1 2 Crest ( , , ) 9 7 3 Other ( , ) 5 4

123 Classification of transitions
separating pre-separating pre-inner, non M-destructible pre-inner, M-destructible inner, non minimal inner, minimal

124 Illustration F Watershed of F M-watershed of F 1 2 9 8 5 7 3 4 6 1 7 6
1 2 9 8 5 7 3 4 6 F 1 7 6 Watershed of F 9 8 7 6 1 M-watershed of F

125 Illustration 9 8 7 6 1 1 1 2 9 8 5 7 3 4 6

126 Priority function 1 10 1 2 3 4 1 4 5 6 7 8 9 10

127 M-watershed algorithm

128 Watershed algorithm Repeat until stability Select a W-destructible point p, according to a certain criterion Lower the value of p If we give the greatest priority to a W-destructible point which may be W-lowered down to the lowest possible value, we can prove that the same point cannot be selected twice by the algorithm.

129 Watershed algorithm

130 Conclusion For a binary watershed :
Component tree building Minima labelling M-thinning O(n  e(n)) O(n) O(n) For a (grayscale) topological watershed : Component tree building M-thinning W-thinning O(n  e(n)) O(n) O(n)

131 Conclusion First algorithm Proved complexity and correctness Fast
General (weighted graph) The implementation is achievable The pre-processing step (component tree building) is also useful for filtering purposes

132 Perspectives Saliency (L. Najman) Integration of the filtering step
Parallelism ? Architecture ?

133

134 Algorithm (Najman and Couprie)

135 Type checking

136 Type checking

137 « Light » component tree
« Branch » vertices are deleted Only forks and leaves are kept

138 Component mapping

139 Least common ancestor lca(A,B,C,D) D A C B

140 Perspectives Saliency (L. Najman) Integration of the filtering step
Drop of water paradigm Parallelism ? Architecture ?

141 Quasi-linear algorithms for the topological watershed
Michel Couprie

142 Contributors to this work
Gilles Bertrand Michel Couprie Laurent Najman


Download ppt "Quasi-linear algorithms for the topological watershed"

Similar presentations


Ads by Google