149
Mathematical Morphology Isabelle Bloch http://www.tsi.enst.fr/˜bloch Ecole Nationale Sup ´ erieure des T ´ el ´ ecommunications - CNRS UMR 5141 LTCI Paris - France Mathematical Morphology – p.1/84

MathematicalMorphology - Telecom Paris

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: MathematicalMorphology - Telecom Paris

Mathematical Morphology

Isabelle Bloch

http://www.tsi.enst.fr/˜bloch

Ecole Nationale Superieure des Telecommunications - CNRS UMR 5141 LTCI

Paris - France

Mathematical Morphology – p.1/84

Page 2: MathematicalMorphology - Telecom Paris

A few references

• J. Serra, Image Analysis and Mathematical Morphology, Academic Press,New-York, 1982.

• J. Serra (Ed.), Image Analysis and Mathematical Morphology, Part II: TheoreticalAdvances, Academic Press, London, 1988.

• P. Soille, Morphological Image Analysis, Springer-Verlag, Berlin, 1999.

Mathematical Morphology – p.2/84

Page 3: MathematicalMorphology - Telecom Paris

Shape or spatial relations?

Mathematical Morphology – p.3/84

Page 4: MathematicalMorphology - Telecom Paris

Simplifying and selecting relevant information...

Mathematical Morphology – p.4/84

Page 5: MathematicalMorphology - Telecom Paris

Introduction

• Origin: study of porous media

• Principle: study of objects (images) based on:• shape, geometry, topology• grey levels, colors• neighborhood information

• Mathematical bases:• set theory• topology• geometry• algebra (lattice theory)• probabilities, random closed sets• functions

• Main characteristics:• non linear• non invertible• strong properties• associated algorithms

Mathematical Morphology – p.5/84

Page 6: MathematicalMorphology - Telecom Paris

Tools for

• filtering

• segmentation

• measures (distances, granulometry, integral geometry, topology, stochasticprocesses...)

• texture analysis

• shape recognition

• scene interpretation

• ...

Applications in numerous domains

Mathematical Morphology – p.6/84

Page 7: MathematicalMorphology - Telecom Paris

Example

Mathematical Morphology – p.7/84

Page 8: MathematicalMorphology - Telecom Paris

Example

Mathematical Morphology – p.7/84

Page 9: MathematicalMorphology - Telecom Paris

Four fundamental principles

1. Compatibility with translations

2. Compatibility with scaling

3. Local knowledge

4. Continuity (semi-continuity)

Mathematical Morphology – p.8/84

Page 10: MathematicalMorphology - Telecom Paris

Structuring element

• shape

• size• origin (not necessarily in B)

• examples:

Continuous: Digital:

Mathematical Morphology – p.9/84

Page 11: MathematicalMorphology - Telecom Paris

Binary dilation

• Minkowski addition:X ⊕ Y = x+ y / x ∈ X, y ∈ Y

• Binary dilation:

D(X,B) = X ⊕ B = x+ y / x ∈ X, y ∈ B (or = X ⊕B)

=⋃

x∈X

Bx = x ∈ Rn / Bx ∩X 6= ∅

Properties of dilation:

• extensive (X ⊆ D(X,B)) if O ∈ B;

• increasing (X ⊆ Y ⇒ D(X,B) ⊆ D(Y,B));

• B ⊆ B′ ⇒ D(X,B) ⊆ D(X,B′);

• commutes with union, not with intersection:

D(X ∪ Y,B) = D(X,B) ∪D(Y,B), D(X ∩ Y,B) ⊆ D(X,B) ∩D(Y,B);

• iterativity property: D[D(X,B), B′] = D(X,B ⊕B′).

Mathematical Morphology – p.10/84

Page 12: MathematicalMorphology - Telecom Paris

Binary dilation

• Minkowski addition:X ⊕ Y = x+ y / x ∈ X, y ∈ Y

• Binary dilation:

D(X,B) = X ⊕ B = x+ y / x ∈ X, y ∈ B (or = X ⊕B)

=⋃

x∈X

Bx = x ∈ Rn / Bx ∩X 6= ∅

Properties of dilation:

• extensive (X ⊆ D(X,B)) if O ∈ B;

• increasing (X ⊆ Y ⇒ D(X,B) ⊆ D(Y,B));

• B ⊆ B′ ⇒ D(X,B) ⊆ D(X,B′);

• commutes with union, not with intersection:

D(X ∪ Y,B) = D(X,B) ∪D(Y,B), D(X ∩ Y,B) ⊆ D(X,B) ∩D(Y,B);

• iterativity property: D[D(X,B), B′] = D(X,B ⊕B′).

Mathematical Morphology – p.10/84

Page 13: MathematicalMorphology - Telecom Paris

Example of dilation

Mathematical Morphology – p.11/84

Page 14: MathematicalMorphology - Telecom Paris

Binary erosion

E(X,B) = x ∈ Rn / Bx ⊆ X

= x / ∀y ∈ B, x+ y ∈ X = X B.

Properties of erosion:

• duality of erosion and dilation with respect to complementation:

E(X,B) = [D(XC , B)]C (or E(X,B) = [D(XC , B)]C)

• anti-extensive (E(X,B) ⊆ X) if O ∈ B;

• increasing (X ⊆ Y ⇒ E(X,B) ⊆ E(Y,B));

• B ⊆ B′ ⇒ E(X,B′) ⊆ E(X,B);

• commutes with intersection, not with union:

E[(X ∩ Y ), B] = E(X,B) ∩ E(Y,B), E[(X ∪ Y ), B] ⊇ E(X,B) ∪ E(Y,B);

• iterativity property: E[E(X,B), B′] = E(X,B ⊕B′).

• D[E(X,B), B′] ⊆ E[D(X,B′), B].

Mathematical Morphology – p.12/84

Page 15: MathematicalMorphology - Telecom Paris

Binary erosion

E(X,B) = x ∈ Rn / Bx ⊆ X

= x / ∀y ∈ B, x+ y ∈ X = X B.

Properties of erosion:

• duality of erosion and dilation with respect to complementation:

E(X,B) = [D(XC , B)]C (or E(X,B) = [D(XC , B)]C)

• anti-extensive (E(X,B) ⊆ X) if O ∈ B;

• increasing (X ⊆ Y ⇒ E(X,B) ⊆ E(Y,B));

• B ⊆ B′ ⇒ E(X,B′) ⊆ E(X,B);

• commutes with intersection, not with union:

E[(X ∩ Y ), B] = E(X,B) ∩ E(Y,B), E[(X ∪ Y ), B] ⊇ E(X,B) ∪ E(Y,B);

• iterativity property: E[E(X,B), B′] = E(X,B ⊕B′).

• D[E(X,B), B′] ⊆ E[D(X,B′), B].Mathematical Morphology – p.12/84

Page 16: MathematicalMorphology - Telecom Paris

Example of erosion

Mathematical Morphology – p.13/84

Page 17: MathematicalMorphology - Telecom Paris

Links with distances

Mathematical Morphology – p.14/84

Page 18: MathematicalMorphology - Telecom Paris

Links with distances

Mathematical Morphology – p.14/84

Page 19: MathematicalMorphology - Telecom Paris

Binary opening

XB = D[E(X,B), B] (or D[E(X,B), B])

Properties of opening:

• anti-extensive (X ⊇ XB);

• increasing (X ⊆ Y ⇒ XB ⊆ YB);

• idempotent ((XB)B = XB).

⇒ Morphological filter

• B ⊆ B′ ⇒ XB′ ⊆ XB ;

• (Xn)n′ = (Xn′ )n = Xmax(n,n′).

Mathematical Morphology – p.15/84

Page 20: MathematicalMorphology - Telecom Paris

Binary opening

XB = D[E(X,B), B] (or D[E(X,B), B])

Properties of opening:

• anti-extensive (X ⊇ XB);

• increasing (X ⊆ Y ⇒ XB ⊆ YB);

• idempotent ((XB)B = XB).

⇒ Morphological filter

• B ⊆ B′ ⇒ XB′ ⊆ XB ;

• (Xn)n′ = (Xn′ )n = Xmax(n,n′).

Mathematical Morphology – p.15/84

Page 21: MathematicalMorphology - Telecom Paris

Example of opening

Mathematical Morphology – p.16/84

Page 22: MathematicalMorphology - Telecom Paris

Binary closing

XB = E[D(X,B), B] (or E[D(X,B), B])

Properties of closing:

• extensive (X ⊆ XB);

• increasing (X ⊆ Y ⇒ XB ⊆ Y B);

• idempotent ((XB)B = XB).

⇒ Morphological filter

• B ⊆ B′ ⇒ XB ⊆ XB′

;

• (Xn)n′

= (Xn′

)n = Xmax(n,n′);

• XB = [(XC)B ]C .

Mathematical Morphology – p.17/84

Page 23: MathematicalMorphology - Telecom Paris

Binary closing

XB = E[D(X,B), B] (or E[D(X,B), B])

Properties of closing:

• extensive (X ⊆ XB);

• increasing (X ⊆ Y ⇒ XB ⊆ Y B);

• idempotent ((XB)B = XB).

⇒ Morphological filter

• B ⊆ B′ ⇒ XB ⊆ XB′

;

• (Xn)n′

= (Xn′

)n = Xmax(n,n′);

• XB = [(XC)B ]C .

Mathematical Morphology – p.17/84

Page 24: MathematicalMorphology - Telecom Paris

Example of closing

Mathematical Morphology – p.18/84

Page 25: MathematicalMorphology - Telecom Paris

Digital case

• choice of the digital grid (both for the image and the structuring element)

• translations on the grid

• same properties

Mathematical Morphology – p.19/84

Page 26: MathematicalMorphology - Telecom Paris

From sets to functions

• subgraph of a function on Rn = subset of R

n+1

• cuts of a function = setsfλ = x|f(x) ≥ λ

D(fλ, B) = [D(f,B)]λ

• functional equivalents of set operations:

∪ → sup / ∨

∩ → inf / ∧

⊆ → ≤

⊇ → ≥

Mathematical Morphology – p.20/84

Page 27: MathematicalMorphology - Telecom Paris

Dilation of a function

by a flat structuring element

∀x ∈ Rn, D(f,B)(x) = supf(y) / y ∈ Bx

Properties of functional dilation:

• extensivity if O ∈ B;

• increasingness;

• D(f ∨ g,B) = D(f,B) ∨D(g,B);

• D(f ∧ g,B) ≤ D(f,B) ∧D(g,B);

• iterativity property.

It holds:D(fλ, B) = [D(f,B)]λ

Mathematical Morphology – p.21/84

Page 28: MathematicalMorphology - Telecom Paris

Dilation of a function

by a flat structuring element

∀x ∈ Rn, D(f,B)(x) = supf(y) / y ∈ Bx

Properties of functional dilation:

• extensivity if O ∈ B;

• increasingness;

• D(f ∨ g,B) = D(f,B) ∨D(g,B);

• D(f ∧ g,B) ≤ D(f,B) ∧D(g,B);

• iterativity property.

It holds:D(fλ, B) = [D(f,B)]λ

Mathematical Morphology – p.21/84

Page 29: MathematicalMorphology - Telecom Paris

Example of functional dilation

Mathematical Morphology – p.22/84

Page 30: MathematicalMorphology - Telecom Paris

Erosion of a function

∀x ∈ Rn, E(f,B)(x) = inff(y) / y ∈ Bx

Properties of functional erosion:

• functional dilation and erosion are dual operators;

• anti-extensivity if O ∈ B;

• increasingness;

• E(f ∨ g,B) ≥ E(f,B) ∨ E(g,B);

• E(f ∧ g,B) = E(f,B) ∧ E(g,B);

• iterativity property.

Mathematical Morphology – p.23/84

Page 31: MathematicalMorphology - Telecom Paris

Erosion of a function

∀x ∈ Rn, E(f,B)(x) = inff(y) / y ∈ Bx

Properties of functional erosion:

• functional dilation and erosion are dual operators;

• anti-extensivity if O ∈ B;

• increasingness;

• E(f ∨ g,B) ≥ E(f,B) ∨ E(g,B);

• E(f ∧ g,B) = E(f,B) ∧ E(g,B);

• iterativity property.

Mathematical Morphology – p.23/84

Page 32: MathematicalMorphology - Telecom Paris

Example of functional erosion

Mathematical Morphology – p.24/84

Page 33: MathematicalMorphology - Telecom Paris

Functional opening

fB = D[E(f,B), B]

Properties of functional opening:

• anti-extensive;• increasing;

• idempotent.

⇒ morphological filter

Mathematical Morphology – p.25/84

Page 34: MathematicalMorphology - Telecom Paris

Functional opening

fB = D[E(f,B), B]

Properties of functional opening:

• anti-extensive;• increasing;

• idempotent.

⇒ morphological filter

Mathematical Morphology – p.25/84

Page 35: MathematicalMorphology - Telecom Paris

Example of functional opening

Mathematical Morphology – p.26/84

Page 36: MathematicalMorphology - Telecom Paris

Functional closing

fB = E[D(f,B), B]

Properties of functional closing:

• extensive;• increasing;

• idempotent.

⇒ morphological filter

• duality between opening and closing

Mathematical Morphology – p.27/84

Page 37: MathematicalMorphology - Telecom Paris

Functional closing

fB = E[D(f,B), B]

Properties of functional closing:

• extensive;• increasing;

• idempotent.

⇒ morphological filter

• duality between opening and closing

Mathematical Morphology – p.27/84

Page 38: MathematicalMorphology - Telecom Paris

Example of functional closing

Mathematical Morphology – p.28/84

Page 39: MathematicalMorphology - Telecom Paris

Structuring functions

Dilation:

D(f, g)(x) = supyf(y) + g(y − x)

Erosion:

E(f, g)(x) = infyf(y)− g(y − x)

Flat structuring element:

g(x) =

0 on a compact B−∞ elsewhere

Mathematical Morphology – p.29/84

Page 40: MathematicalMorphology - Telecom Paris

Some applications of erosion and dilation

Mathematical Morphology – p.30/84

Page 41: MathematicalMorphology - Telecom Paris

Some applications of erosion and dilation

Contrast enhancement

Mathematical Morphology – p.30/84

Page 42: MathematicalMorphology - Telecom Paris

Some applications of erosion and dilation

Contrast enhancement: ES 15, α = β = 0.2, α = β = 0.3, α = β = 0.5

Mathematical Morphology – p.30/84

Page 43: MathematicalMorphology - Telecom Paris

Some applications of erosion and dilation

Contrast enhancement: ES 30, α = β = 0.2, α = β = 0.3, α = β = 0.5

Mathematical Morphology – p.30/84

Page 44: MathematicalMorphology - Telecom Paris

Some applications of erosion and dilation

Morphological gradient: DB(x)− EB(x)

Mathematical Morphology – p.30/84

Page 45: MathematicalMorphology - Telecom Paris

Some applications of erosion and dilation

Ultimate erosion:

EU(X) = ∪nE(X,Bn) \R[E(X,Bn+1);E(X,Bn)]

• E(X,Bn): erosion of X by a structuring element of size n

• R[Y ;Z]: connected components of Z having a non-empty intersection with Y

= set of regional maxima of the distance function d(x,XC).

Mathematical Morphology – p.30/84

Page 46: MathematicalMorphology - Telecom Paris

An application of opening:

top-hat transform

f − fB

Mathematical Morphology – p.31/84

Page 47: MathematicalMorphology - Telecom Paris

An application of opening:

top-hat transform

f − fB

Mathematical Morphology – p.31/84

Page 48: MathematicalMorphology - Telecom Paris

An application of opening:

top-hat transform

f − fB

Mathematical Morphology – p.31/84

Page 49: MathematicalMorphology - Telecom Paris

Granulometry

• ∀X ∈ A, ∀λ > 0, φλ(X) ⊆ X (φλ anti-extensive);

• ∀(X,Y ) ∈ A2, ∀λ > 0, X ⊆ Y ⇒ φλ(X) ⊆ φλ(Y ) (φλ increasing);

• ∀X ∈ A, ∀λ > 0,∀µ > 0 λ ≥ µ⇒ φλ(X) ⊆ φµ(X) (φλ decreasing with respectto the parameter);

• ∀λ > 0,∀µ > 0, φλ φµ = φµ φλ = φmax(λ,µ).

(φλ) is a granulometry iff φλ is an opening for each λ and the class of subsets A whichare invariant under φλ is included in the class of subsets which are invariant under φµ forλ ≥ µ

Mathematical Morphology – p.32/84

Page 50: MathematicalMorphology - Telecom Paris

Granulometry

• ∀X ∈ A, ∀λ > 0, φλ(X) ⊆ X (φλ anti-extensive);

• ∀(X,Y ) ∈ A2, ∀λ > 0, X ⊆ Y ⇒ φλ(X) ⊆ φλ(Y ) (φλ increasing);

• ∀X ∈ A, ∀λ > 0,∀µ > 0 λ ≥ µ⇒ φλ(X) ⊆ φµ(X) (φλ decreasing with respectto the parameter);

• ∀λ > 0,∀µ > 0, φλ φµ = φµ φλ = φmax(λ,µ).

(φλ) is a granulometry iff φλ is an opening for each λ and the class of subsets A whichare invariant under φλ is included in the class of subsets which are invariant under φµ forλ ≥ µ

Mathematical Morphology – p.32/84

Page 51: MathematicalMorphology - Telecom Paris

Granulometry

• ∀X ∈ A, ∀λ > 0, φλ(X) ⊆ X (φλ anti-extensive);

• ∀(X,Y ) ∈ A2, ∀λ > 0, X ⊆ Y ⇒ φλ(X) ⊆ φλ(Y ) (φλ increasing);

• ∀X ∈ A, ∀λ > 0,∀µ > 0 λ ≥ µ⇒ φλ(X) ⊆ φµ(X) (φλ decreasing with respectto the parameter);

• ∀λ > 0,∀µ > 0, φλ φµ = φµ φλ = φmax(λ,µ).

(φλ) is a granulometry iff φλ is an opening for each λ and the class of subsets A whichare invariant under φλ is included in the class of subsets which are invariant under φµ forλ ≥ µ

Mathematical Morphology – p.32/84

Page 52: MathematicalMorphology - Telecom Paris

Vectorial functions (e.g. color images)

• Main difficulty: choice of an ordering

• component-wise max (or min): no good properties

Dilation

maximum ?component−wise

Mathematical Morphology – p.33/84

Page 53: MathematicalMorphology - Telecom Paris

Choice of the structuring element

• depends on what one wants suppress / keep

• shape

• size

Example: opening by disks or segments?

Mathematical Morphology – p.34/84

Page 54: MathematicalMorphology - Telecom Paris

Choice of the structuring element

• depends on what one wants suppress / keep

• shape

• size

Example: opening by disks or segments?

Mathematical Morphology – p.34/84

Page 55: MathematicalMorphology - Telecom Paris

Choice of the structuring element

• depends on what one wants suppress / keep

• shape

• size

Example: opening by disks or segments?

Mathematical Morphology – p.34/84

Page 56: MathematicalMorphology - Telecom Paris

Choice of the structuring element

• depends on what one wants suppress / keep

• shape

• size

Example: opening by disks or segments?

Rq: a union of openings is an opening Mathematical Morphology – p.34/84

Page 57: MathematicalMorphology - Telecom Paris

Surfacic opening

γλ(f) =∨

i

γBi(f), Bi connected and S(Bi) = λ

Mathematical Morphology – p.35/84

Page 58: MathematicalMorphology - Telecom Paris

Surfacic opening

γλ(f) =∨

i

γBi(f), Bi connected and S(Bi) = λ

Mathematical Morphology – p.35/84

Page 59: MathematicalMorphology - Telecom Paris

Surfacic opening

γλ(f) =∨

i

γBi(f), Bi connected and S(Bi) = λ

Mathematical Morphology – p.35/84

Page 60: MathematicalMorphology - Telecom Paris

Mathematical fundaments of mathematical

morphology

• Set theory• relations (⊆, ∩, ∪...)• structuring element

• Topology• hit-or-miss topology (Fell’s topology)• myopic topology• Hausdorff distance

• Lattice theory• adjunctions• algebraic operations

• Probability theory• P (A ∩K 6= ∅)

• random closed sets

Mathematical Morphology – p.36/84

Page 61: MathematicalMorphology - Telecom Paris

Hit-or-miss topology

• topology on closed subsets

• generated by FK and FG (K compact and G open):

FK = F ∈ F , F ∩K = ∅

FG = F ∈ F , F ∩G 6= ∅

• convergence in F : (Fn)n∈N converges towards F ∈ F if:

∀G ∈ G, G ∩ F 6= ∅,∃N, ∀n ≥ N, G ∩ Fn 6= ∅

∀K ∈ K,K ∩ F = ∅,∃N ′,∀n ≥ N ′, K ∩ Fn = ∅

Union is continuous from F × F in F but intersection is not⇓

semi-continuity

Mathematical Morphology – p.37/84

Page 62: MathematicalMorphology - Telecom Paris

Hit-or-miss topology

• topology on closed subsets

• generated by FK and FG (K compact and G open):

FK = F ∈ F , F ∩K = ∅

FG = F ∈ F , F ∩G 6= ∅

• convergence in F : (Fn)n∈N converges towards F ∈ F if:

∀G ∈ G, G ∩ F 6= ∅,∃N, ∀n ≥ N, G ∩ Fn 6= ∅

∀K ∈ K,K ∩ F = ∅,∃N ′,∀n ≥ N ′, K ∩ Fn = ∅

Union is continuous from F × F in F but intersection is not⇓

semi-continuity

Mathematical Morphology – p.37/84

Page 63: MathematicalMorphology - Telecom Paris

Semi-continuity

f : Ω → F

• f upper semi-continuous (u.s.c.) if ∀ω ∈ Ω and ∀(ωn)n∈N ∈ Ω converging towardsω :

limf(ωn) ⊆ f(ω)

• f lower semi-continuous (l.s.c.) if:

limf(ωn) ⊇ f(ω)

lim/lim = ∪/∩ of adherence points

f continuous iff f l.s.c. and u.s.c.

Intersection is u.s.c.

Mathematical Morphology – p.38/84

Page 64: MathematicalMorphology - Telecom Paris

Properties of morphological operations

• the dilation of a closed set by a compact set is continuous

• the dilation of a compact set by a compact set is continuous

• (F,K) 7→ E(F,K) u.s.c.

• (K′,K) 7→ E(K′,K) u.s.c.

• (F,K) 7→ FK u.s.c.

• (K′,K) 7→ K′

K u.s.c.

• (F,K) 7→ FK u.s.c.

• (K′,K) 7→ K′K u.s.c.

Mathematical Morphology – p.39/84

Page 65: MathematicalMorphology - Telecom Paris

Myopic topology

• generated by:

KFG = K ∈ K,K ∩ F = ∅,K ∩G 6= ∅

(F ∈ F , G ∈ G)

• finer than the topology induced on K by the hit-or-miss topology

• equivalent on K \ ∅ to the topology induced by the Hausdorff distance

δ(K,K′) = max supx∈K

d(x,K′), supx′∈K′

d(x′,K)

Rq: δ(K,K′) = infε, K ⊆ D(K′, Bε),K′ ⊆ D(K,Bε)

Mathematical Morphology – p.40/84

Page 66: MathematicalMorphology - Telecom Paris

Algebraic framework: complete lattices

• Lattice: (T ,≤) (≤ ordering) such that ∀(x, y) ∈ T , ∃x ∨ y and ∃x ∧ y

• Complete lattice: every family of elements (finite or not) has a smallest upperbound and a largest lower bound

• ⇒ contains a smallest element 0 and a largest element I:

0 =∧

T =∨

∅ et I =∨

T =∧

• Examples of complete lattices:• (P(E),⊆): complete lattice, Boolean (complemented and distributive):

∀x,∃xC , x ∧ xC = 0 and x ∨ xC = I

x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z) and x ∨ (y ∧ z) = (x ∨ y) ∧ (x ∨ z)

• (F(Rd),⊆)

• functions of Rn in R for the ordering ≤:

f ≤ g ⇔ ∀x ∈ Rn, f(x) ≤ g(x)

• partitionsMathematical Morphology – p.41/84

Page 67: MathematicalMorphology - Telecom Paris

Semi-continuity of functions

• u.s.c. :∀t > f(x),∃V (x),∀y ∈ V (x), t > f(y)

(V (x) neighborhood of x in Rn)

• l.s.c. :∀t < f(x),∃V (x),∀y ∈ V (x), t < f(y)

• a function is u.s.c. iff its sub-graph is closed

• topology on the space of u.s.c. functions = topology induced by the hit-or-misstopology on F(Rn × R)

• the set of u.s.c. functions of Rn in R is a complete lattice for ≤:

f ≤ g ⇔ SG(f) ⊆ SG(g)

Mathematical Morphology – p.42/84

Page 68: MathematicalMorphology - Telecom Paris

Algebraic dilation and erosion

complete lattice (T ,≤)

Algebraic dilation:∀(xi) ∈ T , δ(∨ixi) = ∨iδ(xi)

Algebraic erosion:∀(xi) ∈ T , ε(∧ixi) = ∧iε(xi)

Properties:

• δ(0) = 0 (in P(E), 0 = ∅)

• ε(I) = I (in P(E), I = E)

• δ increasing

• ε increasing

• in P(Rn), δ(X) = ∪x∈Xδ(x)

Mathematical Morphology – p.43/84

Page 69: MathematicalMorphology - Telecom Paris

Adjunctions

(ε, δ) adjunction on (T ,≤):

∀(x, y), δ(x) ≤ y ⇔ x ≤ ε(y)

Properties:

• δ(0) = 0 and ε(I) = I

• (ε, δ) adjunction ⇒ ε = algebraic erosion and δ = algebraic dilation

• δ increasing = algebraic dilation iff ∃ε such that (ε, δ) is an adjunction⇒ ε = algebraic erosion and ε(x) =

y ∈ T , δ(y) ≤ x

• ε increasing = algebraic erosion iff ∃δ such that (ε, δ) is an adjunction⇒ δ = algebraic dilation and δ(x) =

y ∈ T , ε(y) ≥ x

• εδ ≥ Id

• δε ≤ Id

• εδε = ε

• δεδ = δ

• εδεδ = εδ and δεδε = δε

Mathematical Morphology – p.44/84

Page 70: MathematicalMorphology - Telecom Paris

Links with morphological operators

• On the lattice of the subsets of Rn or Z

n, with inclusion:

δ(X) = ∪x∈Xδ(x)

• + invariance under translation ⇒ ∃B, δ(X) = D(X,B)

• Same result on the lattice of functions.• Similar results for erosion.

Mathematical Morphology – p.45/84

Page 71: MathematicalMorphology - Telecom Paris

Algebraic opening and closing

• Algebraic opening: γ increasing, idempotent and anti-extensive

• Algebraic closing: ϕ increasing, idempotent and extensive

• Examples: γ = δε and ϕ = εδ with (ε, δ) = adjunction

• Invariance domain: Inv(ϕ) = x ∈ T , ϕ(x) = x

• γ opening ⇒ γ(x) =∨

y ∈ Inv(γ), y ≤ x

• ϕ closing ⇒ ϕ(x) =∧

y ∈ Inv(ϕ), x ≤ y

• (γi) openings ⇒∨

i γi opening

• (ϕi) closings ⇒∧

i ϕi closing

• γ1 and γ2 openings ⇒ equivalence between:

1. γ1 ≤ γ2

2. γ1γ2 = γ2γ1 = γ1

3. Inv(γ1) ⊆ Inv(γ2)

• ϕ1 and ϕ2 closings ⇒ equivalence between:

1. ϕ2 ≤ ϕ1

2. ϕ1ϕ2 = ϕ2ϕ1 = ϕ1

3. Inv(ϕ1) ⊆ Inv(ϕ2)

Mathematical Morphology – p.46/84

Page 72: MathematicalMorphology - Telecom Paris

Algebraic filter theory

Filter = increasing and idempotent operator

Examples

• openings γ and∨

i γi (anti-extensive filters)

• closings ϕ and∧

i ϕi (extensive filters)

Theorem on filter composition ϕ and ψ such that ϕ ≥ ψ:

• ϕ ≥ ϕψϕ ≥ ϕψ ∨ ψϕ ≥ ϕψ ∧ ψϕ ≥ ψϕψ ≥ ψ

• ϕψ, ψϕ, ϕψϕ and ψϕψ are filters

• Inv(ϕψϕ) = Inv(ϕψ) and Inv(ψϕψ) = Inv(ψϕ)

• ϕψϕ is the smallest filter which is largest than ϕψ ∨ ψϕ

Mathematical Morphology – p.47/84

Page 73: MathematicalMorphology - Telecom Paris

Example: alternate sequential filters

• openings γi and closings ϕi such that:

i ≤ j ⇒ γj ≤ γi ≤ Id ≤ ϕi ≤ ϕj

• Theorem on filter composition ⇒mi = γiϕi, ni = ϕiγi, ri = ϕiγiϕi andsi = γiϕiγi are filters

• Alternate sequential filters:

Mi = mimi−1...m2m1

Ni = nini−1...n2n1

Ri = riri−1...r2r1

Si = sisi−1...s2s1

• Property: i ≤ j ⇒MjMi = Mj , NjNi = Nj , ...

Mathematical Morphology – p.48/84

Page 74: MathematicalMorphology - Telecom Paris

Morphological alternate sequential filters

(...(((fB1)B1 )B2

)B2 )...Bn)Bn

Mathematical Morphology – p.49/84

Page 75: MathematicalMorphology - Telecom Paris

Morphological alternate sequential filters

(...(((fB1)B1 )B2

)B2 )...Bn)Bn

Mathematical Morphology – p.49/84

Page 76: MathematicalMorphology - Telecom Paris

Morphological alternate sequential filters

(...(((fB1)B1 )B2

)B2 )...Bn)Bn

Mathematical Morphology – p.49/84

Page 77: MathematicalMorphology - Telecom Paris

Auto-dual filters

• Operators which are independent of the local contrast, acting similarly on brightand dark areas.

• Example: morphological center

Median[f(x), ψ1(f)(x), ψ2(f)(x)]

• More generally, for operators ψ1, ψ2, ...ψn: (Id ∨ ∧iψi) ∧ ∨iψi

• For instance ψ1(f) = γϕ(f) = (fB)B , ψ2 = ϕγ(f) = (fB)B

Mathematical Morphology – p.50/84

Page 78: MathematicalMorphology - Telecom Paris

Auto-dual filters

• Operators which are independent of the local contrast, acting similarly on brightand dark areas.

• Example: morphological center

Median[f(x), ψ1(f)(x), ψ2(f)(x)]

• More generally, for operators ψ1, ψ2, ...ψn: (Id ∨ ∧iψi) ∧ ∨iψi

• For instance ψ1(f) = γϕ(f) = (fB)B , ψ2 = ϕγ(f) = (fB)B

F

O

O

F

centre

Mathematical Morphology – p.50/84

Page 79: MathematicalMorphology - Telecom Paris

Morphological center: numerical example

Closing Opening

Mathematical Morphology – p.51/84

Page 80: MathematicalMorphology - Telecom Paris

Morphological center: numerical example

Closing then opening Opening then closing

Mathematical Morphology – p.51/84

Page 81: MathematicalMorphology - Telecom Paris

Morphological center: numerical example

Closing then opening Opening then closing

morphological center

Mathematical Morphology – p.51/84

Page 82: MathematicalMorphology - Telecom Paris

Hit-or-Miss Transformation

Structuring element: T = (T1, T2), with T1 ∩ T2 = ∅

HMT:

X ⊗ T = E(X,T1) ∩ E(XC , T2)

Thinning (if O ∈ T1):X T = X \X ⊗ T

Thickening (if O ∈ T2):X T = X ∪X ⊗ T

For T ′ = (T2, T1):

X T = (XC T ′)C

Mathematical Morphology – p.52/84

Page 83: MathematicalMorphology - Telecom Paris

Hit-or-Miss Transformation

Structuring element: T = (T1, T2), with T1 ∩ T2 = ∅

HMT:

X ⊗ T = E(X,T1) ∩ E(XC , T2)

Thinning (if O ∈ T1):X T = X \X ⊗ T

Thickening (if O ∈ T2):X T = X ∪X ⊗ T

For T ′ = (T2, T1):

X T = (XC T ′)C

Mathematical Morphology – p.52/84

Page 84: MathematicalMorphology - Telecom Paris

HMT: examples

Mathematical Morphology – p.53/84

Page 85: MathematicalMorphology - Telecom Paris

HMT: examples

Mathematical Morphology – p.53/84

Page 86: MathematicalMorphology - Telecom Paris

Skeleton: requirements

• compact representation of objects

• thin lines• included and centered in the object

• homotopic to the object

• good representation of the geometry

• invertible (reconstruction of the initial object)

Mathematical Morphology – p.54/84

Page 87: MathematicalMorphology - Telecom Paris

Skeleton: continuous case

A: open setsρ(A) = set of centers of maximal balls of A of radius ρ

Skeleton:

r(A) =⋃

ρ>0

sρ(A)

Characterization:

sρ(A) =⋂

µ>0

[E(A,Bρ) \ [E(A,Bρ)]Bµ]

r(A) =⋃

ρ>0

µ>0

[E(A,Bρ) \ [E(A,Bρ)]Bµ]

Reconstruction:

A =⋃

ρ>0

D(sρ, Bρ)

Mathematical Morphology – p.55/84

Page 88: MathematicalMorphology - Telecom Paris

Properties of the continuous skeleton

• sρ(Eρ0(A)) = sρ+ρ0

(A) ⇒ r(Eρ0(A)) = ∪ρ>ρ0

sρ(A)

• no general formula for the skeleton of the dilation, opening or closing of a set

• A 7→ r(A) is l.s.c. from G in F

• A connected ⇒ r(A) connected

• the skeleton is “thin”: its interior is empty

Mathematical Morphology – p.56/84

Page 89: MathematicalMorphology - Telecom Paris

Skeleton: digital case

• Direct transposition of the continuous case:

S(X) =⋃

n∈N

[E(X,Bn) \ E(X,Bn)B ]

Properties:• centers of digital maximal balls• reconstuction• but poor connectivity properties

• Skeleton from homotopic thinning

1

1 1

0 0

. .

Properties:• perfect topology• no reconstruction

Mathematical Morphology – p.57/84

Page 90: MathematicalMorphology - Telecom Paris

Skeleton: digital case

• Direct transposition of the continuous case:

S(X) =⋃

n∈N

[E(X,Bn) \ E(X,Bn)B ]

Properties:• centers of digital maximal balls• reconstuction• but poor connectivity properties

• Skeleton from homotopic thinning

1

1 1

0 0

. .

Properties:• perfect topology• no reconstruction

Mathematical Morphology – p.57/84

Page 91: MathematicalMorphology - Telecom Paris

Centers of maximal ball vs thinning

Mathematical Morphology – p.58/84

Page 92: MathematicalMorphology - Telecom Paris

Centers of maximal ball vs thinning

Mathematical Morphology – p.58/84

Page 93: MathematicalMorphology - Telecom Paris

Centers of maximal ball vs thinning

Mathematical Morphology – p.58/84

Page 94: MathematicalMorphology - Telecom Paris

Centers of maximal ball vs thinning

Mathematical Morphology – p.58/84

Page 95: MathematicalMorphology - Telecom Paris

Centers of maximal ball vs thinning

Mathematical Morphology – p.58/84

Page 96: MathematicalMorphology - Telecom Paris

Application in brain imaging

(PhD of Jean-François Mangin)

Mathematical Morphology – p.59/84

Page 97: MathematicalMorphology - Telecom Paris

Application in brain imaging

(PhD of Jean-François Mangin)

Mathematical Morphology – p.59/84

Page 98: MathematicalMorphology - Telecom Paris

Application in brain imaging

(PhD of Jean-François Mangin)

Mathematical Morphology – p.59/84

Page 99: MathematicalMorphology - Telecom Paris

Application in brain imaging

(PhD of Jean-François Mangin)

Mathematical Morphology – p.59/84

Page 100: MathematicalMorphology - Telecom Paris

Application in brain imaging

(PhD of Jean-François Mangin)

Mathematical Morphology – p.59/84

Page 101: MathematicalMorphology - Telecom Paris

Application in brain imaging

(PhD of Jean-François Mangin)

Mathematical Morphology – p.59/84

Page 102: MathematicalMorphology - Telecom Paris

Application in brain imaging

(PhD of Jean-François Mangin)

Mathematical Morphology – p.59/84

Page 103: MathematicalMorphology - Telecom Paris

Geodesic operators

Geodesic distance, conditional to X: dX

x

y

X

d (x,y)

d(x,y)

X

• if X is closed, there exits a geodesic arcfor any pair of points of X

• unique if X is simply connected

• X convex ⇔ dX = d

Geodesic ball: BX(x, r) = y ∈ X / dX(x, y) ≤ r

Rq: BX(x, r) ⊆ B(x, r)

Geodesic dilation:

DX(Y,Br) = x ∈ Rn / BX(x, r) ∩ Y 6= ∅ = x ∈ R

n / dX(x, Y ) ≤ r

Geodesic erosion:

EX(Y,Br) = x ∈ Rn / BX(x, r) ⊆ Y = X \DX(X \ Y,Br)

Geodesic opening and closing: by composition

Mathematical Morphology – p.60/84

Page 104: MathematicalMorphology - Telecom Paris

Properties and reconstruction

Properties:

• similar as in the Euclidean case• DX(Y,Br) ⊆ D(Y,Br)

• DX(Y,Br) = ∩∞n=1[(Y ⊕ rnB) ∩X]n

Digital case:DX(Y,Br) = [D(Y,B1) ∩X]r

Reconstruction:[D(Y,B1) ∩X]∞ = D∞X (Y )

= connected components of X which intersect Y

Mathematical Morphology – p.61/84

Page 105: MathematicalMorphology - Telecom Paris

Binary reconstruction: example

Mathematical Morphology – p.62/84

Page 106: MathematicalMorphology - Telecom Paris

Binary reconstruction: example

Mathematical Morphology – p.62/84

Page 107: MathematicalMorphology - Telecom Paris

Binary reconstruction: example

Mathematical Morphology – p.62/84

Page 108: MathematicalMorphology - Telecom Paris

Geodesic operators on functions

X1 ⊆ X2 and Y1 ⊆ Y2 ⇒ DX1(Y1, Br) ⊆ DX2

(Y1, Br) ⊆ DX2(Y2, Br)

⇒ Extension to functions, for f ≤ g, cut by cut:

[Dg(f,Br)]λ = Dgλ(fλ, Br)

(with fλ = x, f(x) ≥ λ)

Digital case:

Dg(f,Br) = [D(f,B1) ∧ g]r

Eg(f,Br) = [E(f,B1) ∨ g]r

Numerical reconstruction of f (marker function) in g:

• by dilation Dg(f,B∞) = D∞g (f): opening

• by erosion Eg(f,B∞): closing

• opening by reconstruction: D∞f

(fB) (flat areas whose contours are some

contours of the original image ⇒ compression)

Mathematical Morphology – p.63/84

Page 109: MathematicalMorphology - Telecom Paris

Numerical reconstruction: example

Mathematical Morphology – p.64/84

Page 110: MathematicalMorphology - Telecom Paris

Numerical reconstruction: example

Mathematical Morphology – p.64/84

Page 111: MathematicalMorphology - Telecom Paris

Numerical reconstruction: example

Mathematical Morphology – p.64/84

Page 112: MathematicalMorphology - Telecom Paris

Numerical reconstruction: example

Mathematical Morphology – p.64/84

Page 113: MathematicalMorphology - Telecom Paris

Opening by reconstruction: examples

Mathematical Morphology – p.65/84

Page 114: MathematicalMorphology - Telecom Paris

Opening by reconstruction: examples

Union of openings by segments of length 20 and reconstructionMathematical Morphology – p.65/84

Page 115: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

Mathematical Morphology – p.66/84

Page 116: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with an hexagon (maximal size = 1)Mathematical Morphology – p.66/84

Page 117: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with an hexagon (maximal size = 3)Mathematical Morphology – p.66/84

Page 118: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with an hexagon (maximal size = 5)Mathematical Morphology – p.66/84

Page 119: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with an hexagon (maximal size = 9)Mathematical Morphology – p.66/84

Page 120: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with segments (maximal size = 1)Mathematical Morphology – p.66/84

Page 121: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with segments (maximal size = 3)Mathematical Morphology – p.66/84

Page 122: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with segments (maximal size = 5)Mathematical Morphology – p.66/84

Page 123: MathematicalMorphology - Telecom Paris

Application to alternate sequential filters

ASF with segments (maximal size = 9)Mathematical Morphology – p.66/84

Page 124: MathematicalMorphology - Telecom Paris

Regional maxima

X regional maximum of f if

∀x ∈ X, f(x) = λ et X = CC(fλ)

Computation of regional maxima:

f −D∞f (f − 1)

h-maxima (grey level dynamics):

f −D∞f (f − h)

⇒ robust maxima

Mathematical Morphology – p.67/84

Page 125: MathematicalMorphology - Telecom Paris

Regional maxima: example

Mathematical Morphology – p.68/84

Page 126: MathematicalMorphology - Telecom Paris

Robust maxima: example

Mathematical Morphology – p.69/84

Page 127: MathematicalMorphology - Telecom Paris

Skeleton by influence zones

X =⋃

i Xi

Influence zone of Xi in XC :

ZI(Xi) = x ∈ XC / d(x,Xi) < d(x,X \Xi)

Skeleton by influence zones:

Skiz(X) = (⋃

i

ZI(Xi))C

= generalized Voronoï diagram

Properties:

• Skiz(X) ⊆ Skel(XC)

• Skiz is not necessarily connected (even if XC is)

Mathematical Morphology – p.70/84

Page 128: MathematicalMorphology - Telecom Paris

Skeleton by influence zones: examples

Mathematical Morphology – p.71/84

Page 129: MathematicalMorphology - Telecom Paris

Skeleton by influence zones: examples

Mathematical Morphology – p.71/84

Page 130: MathematicalMorphology - Telecom Paris

Skeleton and skeleton by influence zones

Skiz(X) ⊆ r(XC)

Mathematical Morphology – p.72/84

Page 131: MathematicalMorphology - Telecom Paris

Skeleton and skeleton by influence zones

Skiz(X) ⊆ r(XC)

Mathematical Morphology – p.72/84

Page 132: MathematicalMorphology - Telecom Paris

Geodesic skeleton by influence zones

Y = ∪iYi

Geodesic influence zone of Yi conditionally to X :

ZIX(Yi) = x ∈ X, dX(x, Yi) < dX(x, Y \ Yi)

Geodesic skeleton by influence zones:

SKIZX(Y ) = X \⋃

i

ZIX(Yi)

X

SKIZ(Y)

1Y

2Y

1Y

2Y

SKIZ (Y)

X

Mathematical Morphology – p.73/84

Page 133: MathematicalMorphology - Telecom Paris

Cortex segmentation

(PhD of Arnaud Cachia)

Mathematical Morphology – p.74/84

Page 134: MathematicalMorphology - Telecom Paris

Cortex segmentation

(PhD of Arnaud Cachia)

Mathematical Morphology – p.74/84

Page 135: MathematicalMorphology - Telecom Paris

Watersheds

watersheds

minimum

minimum

catchment basins

Mathematical Morphology – p.75/84

Page 136: MathematicalMorphology - Telecom Paris

Watersheds: definition

Steepest descent:

Desc(x) = maxf(x)− f(y)

d(x, y), y ∈ V (x)

Ramp of a path π = (x0, ...xn):

Tf (π) =n

i=1

d(xi−1, xi)Cost(xi−1, xi)

with

Cost(x, y) =

Desc(x) if f(x) > f(y)

Desc(y) if f(y) > f(x)

(Desc(x) +Desc(y))/2 if f(y) = f(x)

Mathematical Morphology – p.76/84

Page 137: MathematicalMorphology - Telecom Paris

Watersheds: definition

Topographic distance

Tf (x, y) = infTf (π), π = (x0 = x, x1, ..., xn = y)

(equals 0 on a plateau)

Catchment basin associated to the regional minimum Mi:

BV (Mi) = x, ∀j 6= i, Tf (x,Mi) < Tf (x,Mj)

Watersheds:LPE(f) = [∪iBV (Mi)]

C

Mathematical Morphology – p.76/84

Page 138: MathematicalMorphology - Telecom Paris

Approach by immersion

Mathematical Morphology – p.77/84

Page 139: MathematicalMorphology - Telecom Paris

Construction of the watersheds

f such that f(x) ∈ [hmin, hmax], fh = x, f(x) ≤ h

Xhmin= fhmin

Xh+1 = MinRegh+1(f) ∪ ZIfh+1 (Xh)

BV = Xhmax

LPE(f) = XChmax

Mathematical Morphology – p.78/84

Page 140: MathematicalMorphology - Telecom Paris

Illustration of the algorithm

Mathematical Morphology – p.79/84

Page 141: MathematicalMorphology - Telecom Paris

Illustration of the algorithm

Mathematical Morphology – p.79/84

Page 142: MathematicalMorphology - Telecom Paris

Illustration of the algorithm

Mathematical Morphology – p.79/84

Page 143: MathematicalMorphology - Telecom Paris

Illustration of the algorithm

Mathematical Morphology – p.79/84

Page 144: MathematicalMorphology - Telecom Paris

Watersheds and oversegmentation

Mathematical Morphology – p.80/84

Page 145: MathematicalMorphology - Telecom Paris

Watersheds and oversegmentation

Mathematical Morphology – p.80/84

Page 146: MathematicalMorphology - Telecom Paris

Geodesic erosion

in order to impose markers

Mathematical Morphology – p.81/84

Page 147: MathematicalMorphology - Telecom Paris

Watersheds constraint by markers

f : function on which watersheds should be appliedg: marker function (selects regional minima)Reconstruction: Ef∧g(g,B∞) (only the selected minima)

Mathematical Morphology – p.82/84

Page 148: MathematicalMorphology - Telecom Paris

Separation of connected binary objects

Mathematical Morphology – p.83/84

Page 149: MathematicalMorphology - Telecom Paris

And much more...

Mathematical Morphology – p.84/84