Discrete Morphology and Distances on graphs Jean Cousty Four-Day - - PowerPoint PPT Presentation

discrete morphology and distances on graphs
SMART_READER_LITE
LIVE PREVIEW

Discrete Morphology and Distances on graphs Jean Cousty Four-Day - - PowerPoint PPT Presentation

Discrete Morphology and Distances on graphs Jean Cousty Four-Day Course on Mathematical Morphology in image analysis Bangalore 19-22 October 2010 J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology 1/34 Mathematical Morphology


slide-1
SLIDE 1

Discrete Morphology and Distances on graphs

Jean Cousty Four-Day Course

  • n

Mathematical Morphology in image analysis

Bangalore 19-22 October 2010

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

1/34

slide-2
SLIDE 2

Mathematical Morphology (MM) allows to process

Continuous planes Discrete grids Continuous manifolds Triangular meshes

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

2/34

slide-3
SLIDE 3

Problem Is there generic structures that allow MM operators to be studied and implemented in computers?

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

3/34

slide-4
SLIDE 4

Problem Is there generic structures that allow MM operators to be studied and implemented in computers? Proposition Graphs constitute such a structure for digital geometric objects

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

3/34

slide-5
SLIDE 5

Outline

1 Graphs

Graphs for discrete geometric objects Morphological operators in graphs Dilation algorithm in graphs

2 Distance transforms

Geodesic distance (transform) in graphs Iterated morphological operators Distance transform algorithm in graphs

3 Medial axis

Example of application Algorithm

4 Related problems

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

4/34

slide-6
SLIDE 6

Graphs

What is a graph ?

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

5/34

slide-7
SLIDE 7

Graphs

What is a graph ?

Definition A graph G is a pair (V , E) made of: A set V whose elements {x ∈ V } are called points or vertices of G

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

5/34

slide-8
SLIDE 8

Graphs

What is a graph ?

Definition A graph G is a pair (V , E) made of: A set V whose elements {x ∈ V } are called points or vertices of G A binary relation E on V (i.e., E ⊆ V × V ) whose elements {(x, y) ∈ E} are called edges of G

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

5/34

slide-9
SLIDE 9

Graphs

What is a graph ?

Definition The graph (V , E) is symmetric whenever: (x, y) ∈ E = ⇒ (y, x) ∈ E The graph (V , E) is reflexive if: ∀x ∈ V , (x, x) ∈ E

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

5/34

slide-10
SLIDE 10

Graphs

What is a graph ?

x y

4-adjacency 8-adjacency 6-adjacency Symmetric & reflexive graph for 2D image analysis The vertex set V is the image domain The edge set E is given by an “adjacency” relation

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

5/34

slide-11
SLIDE 11

Graphs

What is a graph ?

6-adjacency 18-adjacency 26-adjacency Symmetric & reflexive graph for 3D image analysis The vertex set V is the image domain The edge set E is given by an “adjacency” relation

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

5/34

slide-12
SLIDE 12

Graphs

What is a graph ?

Symmetric & reflexive graph for mesh analysis The vertex set V is the image domain The edge set E is given by an “adjacency” relation

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

5/34

slide-13
SLIDE 13

Graphs

Neighborhood x

Definition We call neighborhood of a vertex (in G) the set of all vertices linked (by an edge in G) to this vertex: ∀x ∈ V , Γ(x) = {y ∈ V | (x, y) ∈ E}

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

6/34

slide-14
SLIDE 14

Graphs

Neighborhood x y z

Definition The neighborhood (in G) of a subset of vertices, is the union of the neighborhood of the vertices in this set: ∀X ⊆ V , Γ(X) = ∪x∈XΓ(x)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

6/34

slide-15
SLIDE 15

Graphs

Neighborhood x y z

Definition The neighborhood (in G) of a subset of vertices, is the union of the neighborhood of the vertices in this set: ∀X ⊆ V , Γ(X) = ∪x∈XΓ(x)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

6/34

slide-16
SLIDE 16

Graphs

Algebraic Dilation & graph

Property Whatever the graph G, the map Γ : P(V ) → P(V ) is an (algebraic) dilation

Γ commutes with the supremum

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

7/34

slide-17
SLIDE 17

Graphs

Morphological Dilation & graph

Property If V is discrete and equipped with a translation T If X and B are subsets of V Then, X ⊕ B = Γ(X), where E is made of all pairs (x, y) ∈ V × V such that y ∈ Bx uncover¡2-¿

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

8/34

slide-18
SLIDE 18

Graphs

Morphological Dilation & graph

Property If V is discrete and equipped with a translation T If X and B are subsets of V Then, X ⊕ B = Γ(X), where E is made of all pairs (x, y) ∈ V × V such that y ∈ Bx Conversely, Property If V is equipped with a translation T , and an origin o ∈ V If G is translation invariant (∀x, y ∈ V , Γ(x) = Tt(Γ(y))), Then, Γ(X) = X ⊕ B, with B = Γ(o) uncover¡2-¿

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

8/34

slide-19
SLIDE 19

Graphs

Dilation, erosion, opening, closing & graph

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

9/34

slide-20
SLIDE 20

Graphs

Dilation, erosion, opening, closing & graph

Reminder The adjoint erosion of Γ:

  • btained by duality

Elementary openings and closings:

  • btained by composition of adjoint dilations and erosion’s
  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

9/34

slide-21
SLIDE 21

Graphs

Dilation Algorithm

Algorithm Input: A graph G = (V , E) and a subset X of V Y := ∅ For each x ∈ V do

if x ∈ X do

For each y ∈ Γ(x) do Y := Y ∪ {x}

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

10/34

slide-22
SLIDE 22

Graphs

Dilation Algorithm

Algorithm Input: A graph G = (V , E) and a subset X of V Y := ∅ For each x ∈ V do

if x ∈ X do

For each y ∈ Γ(x) do Y := Y ∪ {x}

Data Structures Each element of V is represented by an integer between 0 and |V | − 1 The map Γ is represented by an array of |V | lists Sets X and Y are represented by Boolean arrays

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

10/34

slide-23
SLIDE 23

Graphs

Dilation Algorithm: Complexity analysis

Algorithm Input: A graph G = (V , E) and a subset X of V Y := ∅ O(1) For each x ∈ V do O(|V |)

if x ∈ X do O(|V |)

For each y ∈ Γ(x) do Y := Y ∪ {x} O(|V | + |E|)

Data Structures Each element of V is represented by an integer between 0 and |V | − 1 The map Γ is represented by an array of |V | lists Sets X and Y are represented by Boolean arrays

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

10/34

slide-24
SLIDE 24

Distance transforms

Toward granulometries: iterated dilation

Usual granulometric studies of X require

ΓN(X) for each possible value of N

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

11/34

slide-25
SLIDE 25

Distance transforms

Toward granulometries: iterated dilation

Usual granulometric studies of X require

ΓN(X) for each possible value of N

How can ΓN(X) be computed?

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

11/34

slide-26
SLIDE 26

Distance transforms

Toward granulometries: iterated dilation

Usual granulometric studies of X require

ΓN(X) for each possible value of N

How can ΓN(X) be computed? Applying N times the preceding algorithm?

Complexity O(N × (|V | + |E|))

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

11/34

slide-27
SLIDE 27

Distance transforms

Toward granulometries: iterated dilation

Usual granulometric studies of X require

ΓN(X) for each possible value of N

How can ΓN(X) be computed? Applying N times the preceding algorithm?

Complexity O(N × (|V | + |E|))

Problem Efficient computation of ΓN(X)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

11/34

slide-28
SLIDE 28

Distance transforms

Distance transforms: intuition

X (in black)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

12/34

slide-29
SLIDE 29

Distance transforms

Distance transforms: intuition

Distance transform of X

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

12/34

slide-30
SLIDE 30

Distance transforms

Distance transforms: intuition

./Figures/zebreDilation.avi Thresholds: {ΓN}

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

12/34

slide-31
SLIDE 31

Distance transforms

Paths

Let π = x0, . . . , xk be an ordered sequence of vertices π is a path from x0 to xk if:

any two consecutive vertices of π are linked by an edge: ∀i ∈ [1, k], (xi−1, xi) ∈ E

x0 x x x x

1 2 3 4

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

13/34

slide-32
SLIDE 32

Distance transforms

Length of a path

Let π = x0, . . . , xk be a path The length of π, denoted by L(π), is the integer k

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

14/34

slide-33
SLIDE 33

Distance transforms

Length of a path

Let π = x0, . . . , xk be a path The length of π, denoted by L(π), is the integer k

x0 x x x x

1 2 3 4

Path of length 4

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

14/34

slide-34
SLIDE 34

Distance transforms

Length of a path in a weighted graph

Let ℓ be a map from E into R: u → ℓ(u), the length of the edge u The pair (G, ℓ) is called a weighted graph or a network Length of red edges: 1 Length of blue edges: √ 2

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

15/34

slide-35
SLIDE 35

Distance transforms

Length of a path in a weighted graph

Let ℓ be a map from E into R: u → ℓ(u), the length of the edge u The pair (G, ℓ) is called a weighted graph or a network The length of a path π = x0, . . . , xk is the sum of the length of the edges along π: L(π) = k

i=1 ℓ ((xi−1, xi))

x0 x x

1 2

x

3

Length of red edges: 1 Length of blue edges: √ 2 Path of length 2 + √ 2 ≈ 3.4

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

15/34

slide-36
SLIDE 36

Distance transforms

Graph distance

Let x and y be two vertices The distance between x and y is defined by:

D(x, y) = min{L(π) | π is a path from x to y} x y

D(x, y) = 4

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

16/34

slide-37
SLIDE 37

Distance transforms

Graph distance

Property If the graph G is symmetric, then the map D is a distance on V :

∀x ∈ V , D(x, x) = 0 ∀x, y ∈ V , x = y = ⇒ D(x, y) > 0 (positive) ∀x, y ∈ V , D(x, y) = d(y, x) (symmetric) ∀x, y, z ∈ V , D(x, z) ≤ D(x, y) + D(y, z) (triangular inequality)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

17/34

slide-38
SLIDE 38

Distance transforms

Graph distance

Property If the graph G is symmetric, then the map D is a distance on V :

∀x ∈ V , D(x, x) = 0 ∀x, y ∈ V , x = y = ⇒ D(x, y) > 0 (positive) ∀x, y ∈ V , D(x, y) = d(y, x) (symmetric) ∀x, y, z ∈ V , D(x, z) ≤ D(x, y) + D(y, z) (triangular inequality)

Terminology In this case of graph, the distance D is called geodesic

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

17/34

slide-39
SLIDE 39

Distance transforms

Distance Transform

Let X ⊆ V and x ∈ V The distance between x and X is defined by

D(x, X) = min{D(x, y) | y ∈ X}

x

X black vertices D(x, X)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

18/34

slide-40
SLIDE 40

Distance transforms

Distance Transform

Let X ⊆ V and x ∈ V The distance between x and X is defined by

D(x, X) = min{D(x, y) | y ∈ X}

The distance transform of X is the map from V into R defined by

x → DX(x) = D(x, X)

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 6

X black vertices DX

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

18/34

slide-41
SLIDE 41

Distance transforms

Illustration on an image

Original object X in black

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

19/34

slide-42
SLIDE 42

Distance transforms

Illustration on an image

DX in the (non-weighted) graph induced by the 4-adjacency

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

19/34

slide-43
SLIDE 43

Distance transforms

Illustration on an image

DX in the (non-weighted) graph induced by the 8-adjacency

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

19/34

slide-44
SLIDE 44

Distance transforms

Distance transforms & dilations (in non-weighted graphs)

The level-set of DX at level k (X ⊆ V , k ∈ R) is defined by:

DX[k] = {x ∈ V | DX(x) ≤ k}

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

20/34

slide-45
SLIDE 45

Distance transforms

Distance transforms & dilations (in non-weighted graphs)

The level-set of DX at level k (X ⊆ V , k ∈ R) is defined by:

DX[k] = {x ∈ V | DX(x) ≤ k}

Theorem Γk(X) = DX[k], for any X ⊆ V and any k ∈ N

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

20/34

slide-46
SLIDE 46

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-47
SLIDE 47

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

Example of execution S in red T in blue k = 0

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-48
SLIDE 48

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

Example of execution S in red T in blue k = 0

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-49
SLIDE 49

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1

Example of execution S in red T in blue k = 0

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-50
SLIDE 50

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

Example of execution S in red T in blue k = 1

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-51
SLIDE 51

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Example of execution S in red T in blue k = 1

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-52
SLIDE 52

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Example of execution S in red T in blue k = 1

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-53
SLIDE 53

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Example of execution S in red T in blue k = 2

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-54
SLIDE 54

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2

Example of execution S in red T in blue k = 3

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-55
SLIDE 55

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3

Example of execution S in red T in blue k = 4

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-56
SLIDE 56

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4

Example of execution S in red T in blue k = 5

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-57
SLIDE 57

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5

Example of execution S in red T in blue k = 6

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-58
SLIDE 58

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 6

Example of execution S in red T in blue k = 7

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-59
SLIDE 59

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

Correctness: sketch of the proof by induction At the end of step k, DX(y) = k if and only if there is a path of length k from X to y

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-60
SLIDE 60

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y};

S := T; T := ∅; k := k + 1;

Data Structures Elements of V represented by integers in [0, |V | − 1] Γ represented by an array of |V | lists S and T implemented as lists

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-61
SLIDE 61

Distance transforms

Computing distance transforms (in non-weighted graphs)

Algorithm: Input: X ⊆ V , Results: DX

For each x ∈ V do DX(x) := ∞ S := X; T := ∅; k := 0; While S = ∅ do For each x ∈ S do DX := k For each x ∈ S do

For each y ∈ Γ(x) if DX (y) = ∞ do T := T ∪ {y}; DX (y) := −∞

S := T; T := ∅; k := k + 1;

Complexity O(|V | + |E|)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

21/34

slide-62
SLIDE 62

Distance transforms

Computing distance transforms in weighted graphs

Disjkstra Algorithm (1959) Complexity (using modern data structure)

Same as sorting algorithms

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

22/34

slide-63
SLIDE 63

Distance transforms

Computing distance transforms in weighted graphs

Disjkstra Algorithm (1959) Complexity (using modern data structure)

Same as sorting algorithms For small integers distances: O(|V | + |E|)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

22/34

slide-64
SLIDE 64

Distance transforms

Computing distance transforms in weighted graphs

Disjkstra Algorithm (1959) Complexity (using modern data structure)

Same as sorting algorithms For small integers distances: O(|V | + |E|) For floating point numbers distances: O(log log(|V |) + |E|)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

22/34

slide-65
SLIDE 65

Distance transforms

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

23/34

slide-66
SLIDE 66

Medial axis

Visually, the salient loci of the DT form a “centered skeleton”

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

24/34

slide-67
SLIDE 67

Medial axis

Visually, the salient loci of the DT form a “centered skeleton” Medial axis constitute a first notion of such skeletons

Introduced by Blum in the 60’s

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

24/34

slide-68
SLIDE 68

Medial axis

Medial Axis: grass fire analogy

./Figures/feudeprairie.avi

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

25/34

slide-69
SLIDE 69

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-70
SLIDE 70

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x

x

Γ0(x)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-71
SLIDE 71

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x

x

Γ1(x)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-72
SLIDE 72

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x

x

Γ2(x)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-73
SLIDE 73

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x

x

Γ3(x)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-74
SLIDE 74

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x Γr(x) is called a maximal ball in X if:

Γr(x) ⊆ X ∀y ∈ V , ∀r ′ ∈ N, if Γr(x) ⊆ Γr ′(y) ⊆ X, then Γr(x) = Γr ′(y)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-75
SLIDE 75

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x Γr(x) is called a maximal ball in X if:

Γr(x) ⊆ X ∀y ∈ V , ∀r ′ ∈ N, if Γr(x) ⊆ Γr ′(y) ⊆ X, then Γr(x) = Γr ′(y)

X in red and black A ball which is not maximal in X

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-76
SLIDE 76

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x Γr(x) is called a maximal ball in X if:

Γr(x) ⊆ X ∀y ∈ V , ∀r ′ ∈ N, if Γr(x) ⊆ Γr ′(y) ⊆ X, then Γr(x) = Γr ′(y)

X in red and black A maximal ball

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-77
SLIDE 77

Medial axis

Maximal balls

Definition Γr(x) is called the ball of radius r centered on x Γr(x) is called a maximal ball in X if:

Γr(x) ⊆ X ∀y ∈ V , ∀r ′ ∈ N, if Γr(x) ⊆ Γr ′(y) ⊆ X, then Γr(x) = Γr ′(y)

X in red and black A maximal ball

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

26/34

slide-78
SLIDE 78

Medial axis

Medial Axis

Definition The medial axis of X is the set of centers of maximal balls in X

MA(X) = {x ∈ X | ∃r ∈ N, Γr(x) is a maximal ball in X}

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

27/34

slide-79
SLIDE 79

Medial axis

Medial Axis

Definition The medial axis of X is the set of centers of maximal balls in X

MA(X) = {x ∈ X | ∃r ∈ N, Γr(x) is a maximal ball in X}

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

27/34

slide-80
SLIDE 80

Medial axis

Medial Axis: illustration on images

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

28/34

slide-81
SLIDE 81

Medial axis

Example of application: Virtual Coloscopy

./Figures/ct.avi

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

29/34

slide-82
SLIDE 82

Medial axis

Example of application: Virtual Coloscopy

./Figures/segmentation.avi

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

29/34

slide-83
SLIDE 83

Medial axis

Example of application: Virtual Coloscopy

./Figures/paths.avi

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

29/34

slide-84
SLIDE 84

Medial axis

Example of application: Virtual Coloscopy

./Figures/colono.avi

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

29/34

slide-85
SLIDE 85

Medial axis

Computational characterization

The point x ∈ V is a local maximum of DX if

for any y ∈ Γ(x), DX(y) ≤ DX(y)

Property The medial axis of X is the set of local maxima of DX

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

30/34

slide-86
SLIDE 86

Related problems

Homotopic transform

Medial axis of connected objects can be disconnected Medial Axis

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

31/34

slide-87
SLIDE 87

Related problems

Homotopic transform

Medial axis of connected objects can be disconnected Homotopic skeleton

Kong & Rosenfeld. Digital topology: introduction and survey CVGIP-89 Couprie and Bertrand, New characterizations of simple points in 2D, 3D and 4D discrete spaces, TPAMI-09

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

31/34

slide-88
SLIDE 88

Related problems

Euclidean distance and medial axis

Medial axis for the D4 graph distance

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

32/34

slide-89
SLIDE 89

Related problems

Euclidean distance and medial axis

Medial axis for the Euclidean distance

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

32/34

slide-90
SLIDE 90

Related problems

Euclidean distance and medial axis

Euclidean distance transform

Saito & Toriwaki, New algorithms for Euclidean distance transformation

  • f an n-dimensional digitized picture with applications, PR-94

Remy & Thiel, Exact Medial Axis with Euclidean Distance IVC-05

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

32/34

slide-91
SLIDE 91

Related problems

Opening function

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

33/34

slide-92
SLIDE 92

Related problems

Opening function

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

33/34

slide-93
SLIDE 93

Related problems

Opening function

Figures/OpeningFunction.png

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

33/34

slide-94
SLIDE 94

Related problems

Opening function

Figures/OpeningFunction.png

Vincent, Fast grayscale granulometry algorithms, ISMM’94 Chaussard et al., Opening functions in linear time for chessboard and city-bloc distances (in preparation)

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

33/34

slide-95
SLIDE 95

Related problems

Summary

Introduction of the graph formalism for MM Distance Transform Linear time algorithm for morphological operators in graphs Medial axis

  • J. Serra, J. Cousty, B.S. Daya Sagar : Course on Math. Morphology

34/34