jean cousty morphographs and imagery 2011
TRANSCRIPT
Connected operators
Jean Cousty
MorphoGraphs and Imagery2011
J. Cousty : MorphoGraph and Imagery 1/28
Introduction: a problem seen during practical session
Problem: Fill the holes of the cells
Closing by a structuring element,
Holes are closedBut contours “have moved”
A connected closing by reconstruction
J. Cousty : MorphoGraph and Imagery 2/28
Introduction: a problem seen during practical session
Problem: Fill the holes of the cells
Closing by a structuring element,
Holes are closedBut contours “have moved”
A connected closing by reconstruction
J. Cousty : MorphoGraph and Imagery 2/28
Introduction: a problem seen during practical session
Problem: Fill the holes of the cells
Closing by a structuring element,
Holes are closedBut contours “have moved”
A connected closing by reconstruction
J. Cousty : MorphoGraph and Imagery 2/28
Outline of the lecture
1 Connectivity: reminder
2 Connected openings/closings: the case of sets
3 Connected opening: the case of grayscale images
4 Component tree
J. Cousty : MorphoGraph and Imagery 3/28
Connectivity: reminder
Connexite
E is a set
G = (E , Γ) is a graph
J. Cousty : MorphoGraph and Imagery 4/28
Connectivity: reminder
Connected components of a set
Definition
Let X ⊆ E
The subgraph of G induced by X is the graph (X , ΓX ) such that−→ΓX = {(x , y) ∈
−→Γ | x ∈ X , y ∈ X}
A connected component of the subgraph of G induced by X issimply called a connected component of X
CX denotes the set of all connected components of X
X ⊆ E (in black)
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 5/28
Connectivity: reminder
Connected components of a set
Definition
Let X ⊆ E
The subgraph of G induced by X is the graph (X , ΓX ) such that−→ΓX = {(x , y) ∈
−→Γ | x ∈ X , y ∈ X}
A connected component of the subgraph of G induced by X issimply called a connected component of X
CX denotes the set of all connected components of X
X ⊆ E (in black)
(E = Z2 et Γ = Γ4)J. Cousty : MorphoGraph and Imagery 5/28
Connectivity: reminder
Connected components of a set
Definition
Let X ⊆ E
The subgraph of G induced by X is the graph (X , ΓX ) such that−→ΓX = {(x , y) ∈
−→Γ | x ∈ X , y ∈ X}
A connected component of the subgraph of G induced by X issimply called a connected component of X
CX denotes the set of all connected components of X
Partition of X into connectedcomponents
(E = Z2 et Γ = Γ4)J. Cousty : MorphoGraph and Imagery 5/28
Connectivity: reminder
Connected components of a set
Definition
Let X ⊆ E
The subgraph of G induced by X is the graph (X , ΓX ) such that−→ΓX = {(x , y) ∈
−→Γ | x ∈ X , y ∈ X}
A connected component of the subgraph of G induced by X issimply called a connected component of X
CX denotes the set of all connected components of X
(E = Z2 et Γ = Γ4)J. Cousty : MorphoGraph and Imagery 5/28
Connected openings/closings: the case of sets
Connected openings/closings
Definition
A filter γ on E is a connected opening if
∀X ∈ P(E ), Cγ(X ) ⊆ CXA filter φ on E is a connected closing if
∀X ∈ P(E ), Cγ(X ) ⊆ CX
Property
A connected opening γ is an opening
∀X ,Y ∈ P(E ), X ⊆ Y =⇒ γ(X ) ⊆ γ(Y ) (increasing)∀X ∈ P(E ), γ(γ(X )) = γ(X ) (idempotent)∀X ∈ P(E ), γ(X ) ⊆ X (anti-axtensive)
J. Cousty : MorphoGraph and Imagery 6/28
Connected openings/closings: the case of sets
Connected openings/closings
Definition
A filter γ on E is a connected opening if
∀X ∈ P(E ), Cγ(X ) ⊆ CXA filter φ on E is a connected closing if
∀X ∈ P(E ), Cγ(X ) ⊆ CX
Property
A connected opening γ is an opening
∀X ,Y ∈ P(E ), X ⊆ Y =⇒ γ(X ) ⊆ γ(Y ) (increasing)∀X ∈ P(E ), γ(γ(X )) = γ(X ) (idempotent)∀X ∈ P(E ), γ(X ) ⊆ X (anti-axtensive)
J. Cousty : MorphoGraph and Imagery 6/28
Connected openings/closings: the case of sets
Connected openings/closings
Definition
A filter γ on E is a connected opening if
∀X ∈ P(E ), Cγ(X ) ⊆ CXA filter φ on E is a connected closing if
∀X ∈ P(E ), Cγ(X ) ⊆ CX
Property
A connected closing γ is a closing
∀X ,Y ∈ P(E ), X ⊆ Y =⇒ γ(X ) ⊆ γ(Y ) (increasing)∀X ∈ P(E ), γ(γ(X )) = γ(X ) (idempotence)∀X ∈ P(E ), X ⊆ γ(X ) (extensive)
J. Cousty : MorphoGraph and Imagery 6/28
Connected openings/closings: the case of sets
Example: area connected opening
Definition
Let λ ∈ NThe area connected opening of parameter λ is the operator αλ
on E defined by
∀X ∈ P(E ), αλ(X ) = ∪{C ∈ CX | |C | ≥ λ}
X ⊆ E
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 7/28
Connected openings/closings: the case of sets
Example: area connected opening
Definition
Let λ ∈ NThe area connected opening of parameter λ is the operator αλ
on E defined by
∀X ∈ P(E ), αλ(X ) = ∪{C ∈ CX | |C | ≥ λ}
X ⊆ E
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 7/28
Connected openings/closings: the case of sets
Example: area connected opening
Definition
Let λ ∈ NThe area connected opening of parameter λ is the operator αλ
on E defined by
∀X ∈ P(E ), αλ(X ) = ∪{C ∈ CX | |C | ≥ λ}
α1(X )
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 7/28
Connected openings/closings: the case of sets
Example: area connected opening
Definition
Let λ ∈ NThe area connected opening of parameter λ is the operator αλ
on E defined by
∀X ∈ P(E ), αλ(X ) = ∪{C ∈ CX | |C | ≥ λ}
α2(X )
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 7/28
Connected openings/closings: the case of sets
Example: area connected opening
Definition
Let λ ∈ NThe area connected opening of parameter λ is the operator αλ
on E defined by
∀X ∈ P(E ), αλ(X ) = ∪{C ∈ CX | |C | ≥ λ}
α13(X )
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 7/28
Connected openings/closings: the case of sets
Example: connected opening by reconstruction
Definition
Let M ⊆ E
The opening by reconstruction of (the marker) M is theoperator ψM on E defined by
∀X ∈ P(E ), ψM(X ) = ∪{C ∈ CX | M ∩ C 6= ∅}
X ⊆ E et M (hatched dots)
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 8/28
Connected openings/closings: the case of sets
Example: connected opening by reconstruction
Definition
Let M ⊆ E
The opening by reconstruction of (the marker) M is theoperator ψM on E defined by
∀X ∈ P(E ), ψM(X ) = ∪{C ∈ CX | M ∩ C 6= ∅}
X ⊆ E
et M (hatched dots)
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 8/28
Connected openings/closings: the case of sets
Example: connected opening by reconstruction
Definition
Let M ⊆ E
The opening by reconstruction of (the marker) M is theoperator ψM on E defined by
∀X ∈ P(E ), ψM(X ) = ∪{C ∈ CX | M ∩ C 6= ∅}
������������
����������������������������
����
������
������
������
������
����
X ⊆ E et M (hatched dots)
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 8/28
Connected openings/closings: the case of sets
Example: connected opening by reconstruction
Definition
Let M ⊆ E
The opening by reconstruction of (the marker) M is theoperator ψM on E defined by
∀X ∈ P(E ), ψM(X ) = ∪{C ∈ CX | M ∩ C 6= ∅}
������������
����������������������������
����
������
������
������
������
����
ψM(X )
(E = Z2 et Γ = Γ4)
J. Cousty : MorphoGraph and Imagery 8/28
Connected openings/closings: the case of sets
Properties of connected filters
Property
γ is a connected opening ⇔ ?γ is a connected closing
Property (contour preservation)
If γ is a connected opening or closing, then
∀X ∈ P(E ), ∀(x , y) ∈−→Γ ,
|{x , y} ∩ γ(X )| = 1 =⇒ |{x , y} ∩ X | = 1
J. Cousty : MorphoGraph and Imagery 9/28
Connected openings/closings: the case of sets
Properties of connected filters
Property
γ is a connected opening ⇔ ?γ is a connected closing
Property (contour preservation)
If γ is a connected opening or closing, then
∀X ∈ P(E ), ∀(x , y) ∈−→Γ ,
|{x , y} ∩ γ(X )| = 1 =⇒ |{x , y} ∩ X | = 1
J. Cousty : MorphoGraph and Imagery 9/28
Connected opening: the case of grayscale images
Grayscale connected opening/closing
Definition (connected opening)
An operator γ on I is a connected opening (on I) if
∀F ∈ I, γ(γ(F )) = γ(F ) (idempotence)∀F ,H ∈ I,∀k ∈ Z, Fk ⊆ Hk =⇒ γ(F )k ⊆ γ(H)k (increasing)∀F ∈ I, ∀k ∈ Z, C[γ(F )k ] ⊆ C[Fk ] (connected, anti-extensive)
Definition (connected closing)
An operator γ on I is a connected closing (on I) if
∀F ∈ I, γ(γ(F )) = γ(F ) (idempotence)∀F ,H ∈ I,∀k ∈ Z, Fk ⊆ Hk =⇒ γ(F )k ⊆ γ(H)k (increasing)∀F ∈ I, ∀k ∈ Z, C[γ(F )k ]
⊆ C[Fk ](connected, extensive)
J. Cousty : MorphoGraph and Imagery 10/28
Connected opening: the case of grayscale images
Grayscale connected opening/closing
Definition (connected opening)
An operator γ on I is a connected opening (on I) if
∀F ∈ I, γ(γ(F )) = γ(F ) (idempotence)∀F ,H ∈ I,∀k ∈ Z, Fk ⊆ Hk =⇒ γ(F )k ⊆ γ(H)k (increasing)∀F ∈ I, ∀k ∈ Z, C[γ(F )k ] ⊆ C[Fk ] (connected, anti-extensive)
Definition (connected closing)
An operator γ on I is a connected closing (on I) if
∀F ∈ I, γ(γ(F )) = γ(F ) (idempotence)∀F ,H ∈ I,∀k ∈ Z, Fk ⊆ Hk =⇒ γ(F )k ⊆ γ(H)k (increasing)∀F ∈ I, ∀k ∈ Z, C[γ(F )k ]
⊆ C[Fk ](connected, extensive)
J. Cousty : MorphoGraph and Imagery 10/28
Connected opening: the case of grayscale images
Examples
The stack operator induced by αλ (where λ ∈ N) is a connectedopening on I
The stack operator induced by ψM (where M ⊆ E ) is a connectedopening on IThe stack operator induced by any connected opening on E is aconnected opening on I
I
Altitudes
EE = Z, ∀x ∈ E , Γ(x) = {x , x − 1, x + 1}
Connected components of the level sets (red)
J. Cousty : MorphoGraph and Imagery 11/28
Connected opening: the case of grayscale images
Examples
The stack operator induced by αλ (where λ ∈ N) is a connectedopening on I
The stack operator induced by ψM (where M ⊆ E ) is a connectedopening on IThe stack operator induced by any connected opening on E is aconnected opening on I
Altitudes
I
EE = Z, ∀x ∈ E , Γ(x) = {x , x − 1, x + 1}
Connected components of the level sets (red)
J. Cousty : MorphoGraph and Imagery 11/28
Connected opening: the case of grayscale images
Examples
The stack operator induced by αλ (where λ ∈ N) is a connectedopening on I
The stack operator induced by ψM (where M ⊆ E ) is a connectedopening on IThe stack operator induced by any connected opening on E is aconnected opening on I
Altitudes
I
EE = Z, ∀x ∈ E , Γ(x) = {x , x − 1, x + 1}
Connected components of area greater than 3 (blue)
J. Cousty : MorphoGraph and Imagery 11/28
Connected opening: the case of grayscale images
Examples
The stack operator induced by αλ (where λ ∈ N) is a connectedopening on I
The stack operator induced by ψM (where M ⊆ E ) is a connectedopening on IThe stack operator induced by any connected opening on E is aconnected opening on I
Altitudes
I
EE = Z, ∀x ∈ E , Γ(x) = {x , x − 1, x + 1}
α3(I )
J. Cousty : MorphoGraph and Imagery 11/28
Connected opening: the case of grayscale images
Examples
The stack operator induced by αλ (where λ ∈ N) is a connectedopening on IThe stack operator induced by ψM (where M ⊆ E ) is a connectedopening on I
The stack operator induced by any connected opening on E is aconnected opening on I
Altitudes
I
EE = Z, ∀x ∈ E , Γ(x) = {x , x − 1, x + 1}
α3(I )
J. Cousty : MorphoGraph and Imagery 11/28
Connected opening: the case of grayscale images
Examples
The stack operator induced by αλ (where λ ∈ N) is a connectedopening on IThe stack operator induced by ψM (where M ⊆ E ) is a connectedopening on IThe stack operator induced by any connected opening on E is aconnected opening on I
Altitudes
I
EE = Z, ∀x ∈ E , Γ(x) = {x , x − 1, x + 1}
α3(I )
J. Cousty : MorphoGraph and Imagery 11/28
Connected opening: the case of grayscale images
Grayscale connected opening
Definition
Let F ∈ IThe opening by reconstruction of (the marker) F is theoperator ψF on I defined by
∀H ∈ I, ∀k ∈ Z, [ψF (H)]k = ψ[Fk ](Hk)
E
Altitudes
H
F
H in black, F in blue
J. Cousty : MorphoGraph and Imagery 12/28
Connected opening: the case of grayscale images
Grayscale connected opening
Definition
Let F ∈ IThe opening by reconstruction of (the marker) F is theoperator ψF on I defined by
∀H ∈ I, ∀k ∈ Z, [ψF (H)]k = ψ[Fk ](Hk)
E
Altitudes
H
F
H in black, F in blueJ. Cousty : MorphoGraph and Imagery 12/28
Connected opening: the case of grayscale images
Grayscale connected opening
Definition
Let F ∈ IThe opening by reconstruction of (the marker) F is theoperator ψF on I defined by
∀H ∈ I, ∀k ∈ Z, [ψF (H)]k = ψ[Fk ](Hk)
E
F
Altitudes
H
ψF (H) (in black)J. Cousty : MorphoGraph and Imagery 12/28
Connected opening: the case of grayscale images
Properties
Property (duality)
An operator φ is a connected closing on I if and only if its dual ?φis a connected opening on I, where
∀F ∈ I, ?φ(F ) = −φ(−F )
Property (contour preservation)
If γ is a connected opening or closing on I, then
∀F ∈ I,∀(x , y) ∈−→Γ , γ(F )(x) 6= γ(F )(y) =⇒ F (x) 6= F (y)
J. Cousty : MorphoGraph and Imagery 13/28
Connected opening: the case of grayscale images
Properties
Property (duality)
An operator φ is a connected closing on I if and only if its dual ?φis a connected opening on I, where
∀F ∈ I, ?φ(F ) = −φ(−F )
Property (contour preservation)
If γ is a connected opening or closing on I, then
∀F ∈ I,∀(x , y) ∈−→Γ , γ(F )(x) 6= γ(F )(y) =⇒ F (x) 6= F (y)
J. Cousty : MorphoGraph and Imagery 13/28
Component tree
Component tree
Probleme
How to implement a connected operator?
Data structure: component tree
How to build other connected operators?
Criterion on the nodes of the component tree
J. Cousty : MorphoGraph and Imagery 14/28
Component tree
Notation
In the following, the symbol I denotes a grayscale imageon E : I ∈ I
J. Cousty : MorphoGraph and Imagery 15/28
Component tree
Connected component of an image
Definition
We denote by CI the union of the sets of connected components ofthe level sets of I
CI = ∪{C[Ik ] | k ∈ Z}Each element in CI is called a connected component of I
Altitudes
I
E
Components of I (bold red lines)J. Cousty : MorphoGraph and Imagery 16/28
Component tree
Component tree
Definition
Let C1 and C2 be two components of I in CIWe say that C1 is a child of C2 (for I ) if
C1 ⊆ C2
∀C ′ ∈ CI , if C1 ⊆ C ′ ⊆ C2 then C ′ = C2 or C ′ = C1
The component tree of I is the graph AI = (CI , ΓI ) such that
(C1,C2) ∈ ΓI if C2 is a child of C1
Altitudes
I
E
The relation “is child of” isrepresented by red arrows
J. Cousty : MorphoGraph and Imagery 17/28
Component tree
Component tree
Definition
Let C1 and C2 be two components of I in CIWe say that C1 is a child of C2 (for I ) if
C1 ⊆ C2
∀C ′ ∈ CI , if C1 ⊆ C ′ ⊆ C2 then C ′ = C2 or C ′ = C1
The component tree of I is the graph AI = (CI , ΓI ) such that
(C1,C2) ∈ ΓI if C2 is a child of C1
Altitudes
I
E
The relation “is child of” isrepresented by red arrows
J. Cousty : MorphoGraph and Imagery 17/28
Component tree
Arborescence
Property
If the graph (E , Γ) is connected, then the component tree of I isan arborescence of root E
Altitudes
I
E
J. Cousty : MorphoGraph and Imagery 18/28
Component tree
Simplifying an image by razings
A leaf of the component tree AI of I is called
a regional maximum of I
A leaf of the component tree A−I of −I is called
a regional minimum of I
Given a criterion, it is possible to iteratively remove the leaves ofthe tree AI
Such removal is called a razing
J. Cousty : MorphoGraph and Imagery 19/28
Component tree
Razing: intuition
Altitudes
I
E
Successive razing steps
A maximum has been removed
J. Cousty : MorphoGraph and Imagery 20/28
Component tree
Razing: intuition
Altitudes
I
E
Successive razing steps
A maximum has been removed
J. Cousty : MorphoGraph and Imagery 20/28
Component tree
Razing: intuition
Altitudes
I
E
Successive razing steps
A maximum has been removed
J. Cousty : MorphoGraph and Imagery 20/28
Component tree
Razing: intuition
Altitudes
I
E
Successive razing stepsA maximum has been removed
J. Cousty : MorphoGraph and Imagery 20/28
Component tree
Razing: definition
Definition
Let x ∈ E
The elementary razing νx of I at x is defined b
[νx(I )](y) = I (y)− 1 if x and y belong to a same maximum of I[νx(I )](y) = I (y) otherwise
An image obtained from I by composition of elementary razings iscalled a razing of I
J. Cousty : MorphoGraph and Imagery 21/28
Component tree
Simplifying an image by razings
What criterion (attribute) for selecting a maxima to raze?
J. Cousty : MorphoGraph and Imagery 22/28
Component tree
Razing by area
Altitudes
I
E
surface
J. Cousty : MorphoGraph and Imagery 23/28
Component tree
Razing by depth, or dynamics
Altitudes
I
E
profondeur
J. Cousty : MorphoGraph and Imagery 24/28
Component tree
Razing by volume
volume
E
Altitudes
I
J. Cousty : MorphoGraph and Imagery 25/28
Component tree
Flooding
The dual of a razing is called a flooding
A flooding removes minima by iteratively increasing their values
Property (contour preservation)
If F is a razing or a flooding of I , then
∀(x , y) ∈−→Γ , F (x) 6= F (y) =⇒ I (x) 6= I (y)
Remark. An operator produces razings is not necessarily an opening(counter-examples: razing by dynamics or volume)
J. Cousty : MorphoGraph and Imagery 26/28
Component tree
Flooding
The dual of a razing is called a flooding
A flooding removes minima by iteratively increasing their values
Property (contour preservation)
If F is a razing or a flooding of I , then
∀(x , y) ∈−→Γ , F (x) 6= F (y) =⇒ I (x) 6= I (y)
Remark. An operator produces razings is not necessarily an opening(counter-examples: razing by dynamics or volume)
J. Cousty : MorphoGraph and Imagery 26/28
Component tree
Flooding
The dual of a razing is called a flooding
A flooding removes minima by iteratively increasing their values
Property (contour preservation)
If F is a razing or a flooding of I , then
∀(x , y) ∈−→Γ , F (x) 6= F (y) =⇒ I (x) 6= I (y)
Remark. An operator produces razings is not necessarily an opening(counter-examples: razing by dynamics or volume)
J. Cousty : MorphoGraph and Imagery 26/28
Component tree
Exercise
Draw the image F obtained by razings all components of depth isless than 12
Compare the number of maxima of F and of I
Altitudes
I
E
J. Cousty : MorphoGraph and Imagery 27/28
Component tree
Exercise
Draw the image H obtained by the dual of the previous one, (i.e.,the flooding that removes all components of depth is less than 12)Help
1 Draw −I2 Apply a razing to −I3 Inverse the obtained result
Compare the numbers of minima of H and of I
Altitudes
I
E
J. Cousty : MorphoGraph and Imagery 28/28