Chapter II : Dilation, Erosion

Chapter II : Dilation, Erosion
Set Erosion and Dilation
1 - General Case
2 - Minkowski Operations
3 - Standard Operators
Erosion and Dilation for Functions
Planar Operations
J. Serra
Ecole des Mines de Paris ( 2000 )
Gradient and Laplacian
Course on Math. Morphology II. 1
H.M.T.
H.M.T. and
and Set
Set Erosion
Erosion
•• The
Theobjects
objectsunder
understudy
studyare
arehere
herethe
thesets
setsX⊆Ε.
X⊆Ε.The
The
theory
theoryof
ofmathematical
mathematicalmorphology
morphologydescribes
describesthem
them
–– by
byassociating
associatingwith
withall
allx∈E
x∈Etwo
twoprobes
probesA(x)
A(x)and
and
B(x)
B(x);;
–– and
andby
bytesting
testingcwhether
whetherone
oneisiscontained
containedin
inXXand
and
c
the
theother
otherin
in XX ..
•• The
Thefunctions
functions x→A(x)
x→A(x)and
and x→B(x)
x→B(x)are
arecalled
called
structuring
structuringelements,
elements,and
andthe
theHit-or-Miss
Hit-or-Misstransform
transform
of
of XX(H.M.T.)
(H.M.T.)isisdefined
definedby
bythe
theoperation
operation(Ch.
(Ch.8)
8)
cc
ηη(X)
=
{z:
A(z)
⊆
X
(X) = {z: A(z) ⊆ X ;; B(z)
B(z)⊆⊆X}
X}
•• When
WhenA=∅,
A=∅,η(X)
η(X)becomes
becomesthe
theeroded
erodedof
ofXXby
bythe
the
(variable)
(variable)structuring
structuringelement
element B.
B.One
Onewrites
writes
=={z:
B(z)
⊆⊆X}
εεΒ(X)
(X)
{z:
B(z)
X}
Β
J. Serra
Ecole des Mines de Paris ( 2000 )
Initial image
example of H.M.T.
Course on Math. Morphology II. 2
Adjunction
Adjunction (I)
(I)
•• Set
SetErosion
Erosion::Operation
Operation εεΒΒcommutes
commutes under
under∩
∩::
εεΒ(∩
∩
XX ))=={z:
B(z)
⊆⊆∩
XXi }} == ∩
{z:
B(z)
⊆⊆XXi }}==∩
εεΒ(X
)),,
(∩
∩
{z:
B(z)
∩
∩
{z:
B(z)
∩
(X
i
i
i
i
Β
Β
Β
Β
i
i
Therefore,
Therefore,ititisiseffectively
effectivelyan
an erosion.
erosion.
•• Adjunction
Adjunction::The
Theequivalences
equivalences
XX⊆⊆εεΒ (Y)
⇔
⇔ {x∈X
{x∈X⇒
⇒B(x)
B(x)⊆⊆YY}} ⇔
⇔ ∪{
∪{B(x),
B(x),x∈X
x∈X}}⊆⊆YY
Β (Y)
yield
yield the
theoperation
operation
δδB(X)
= ∪ { B (x), x∈
∈∈XX}}
B(X) = ∪ { B (x), x∈
which
whichcommutes
commutes under
under∪
∪.. The
Thelater
laterisisthus
thusaadilation,
dilation,said
saidto
tobe
beadjoint
adjoint
of
Adjunctionisisan
aninvolution,
involution,since
sinceby
bytaking
takingthe
theinverse
inverseway,
way,we
wesee
see
ofεε....Adjunction
that
thatεεadjoint
adjointof
ofδ.δ.
•• Structuring
StructuringElement
Element:: Since
SinceδδΒΒ(X)
(X)==∪
∪{δ
{δΒΒ(x),
(x), x∈X},
x∈X},the
themapping
mapping
""structuring
structuringelement
element"" xx→
→δδBB(x)
(x)==B(x)
B(x) suffices
sufficesto
tocharacterise
characterise both
both
--dilation
--and
dilation δδ :: X→
X→δ(X)
δ(X)
and erosion
erosion εε :: X→
X→ε(X)
ε(X)..
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 3
Adjunction
Adjunction (II)
(II)
The
TheAdjunction
AdjunctionTheorem
Theorem(E.
(E.Gallois….H
Gallois….H.Heijmans,
.Heijmans,Ch.
Ch.Ronse,
Ronse,J.J.Serra):
Serra):
When
Whentwo
twooperators
operatorsδδand
andεεare
arelinked
linkedby
bythe
theequivalence
equivalence
XX⊆⊆εε(Y)
(Y) ⇔
⇔ δδ(X)
(X)⊆⊆YY
then
thenthey
theynecessarily
necessarilyform
forman
an"erosion-dilation"
"erosion-dilation"doublet.
doublet.
Proof
Proof:: Let
Letbe
beaafamily
familyYYi i,,i∈
i∈I,I, and
andXXsuch
suchthat
that
δ(X)
⇔
δ(X)
δ(X)⊆⊆ ∩
⇔
δ(X)⊆⊆ YYi i for
forevery
everyi∈
i∈II,,
∩YYi i
By
Byadjunction
adjunction:: first
firstinclusion
inclusion ⇔
⇔ XX⊆⊆εε(∩Y
(∩Yi)i)
second
secondinclusion
inclusion ⇔
⇔ XX⊆⊆εεΒΒ(Y
(Yi)i),,i∈
i∈I,I, ⇔
⇔ XX⊆⊆∩ε
∩ε(Y
(Yi)i)
This
Thisimplies
impliesεε((∩
(Yi)i),,i.e.
i.e.that
thatεεisisan
anerosion
erosion((id.
id.for
forthe
thedilation).
dilation).
∩YYi)i)==∩
∩εε(Y
••
First
FirstRepresentation
Representation(J.
(J.Serra)
Serra):: For
Forany
anypair
pair(δ,ε)
(δ,ε)we
wehave
have::
εε(Y)
δδ(X)
(Y) ==∪
(X)⊆⊆Y}
Y}
(X) ==∩
(Y)⊆⊆X}
X}
∪{{XX::δδ(X)
∩{{YY::εε(Y)
Curiously,
Curiously,erosion
erosionappears
appearshere
hereas
asaaunion
unionand
anddilation
dilationas
asan
anintersection
intersection
N.B.
N.B.the
theapproach
approachextends
extends to
tomappings
mappingsfrom
fromone
onelattice
latticeinto
intoanother.
another.
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 4
Representations
Representations and
and Semi-groups
Semi-groups
•• Second
SecondReprésentation.
Représentation.Theorem
Theorem (J.Serra)
(J.Serra)::Every
Everyincreasing
increasingmapping
mappingψψon
onP(E)
P(E)can
can
be
bewritten
writtenas
asaaunion
unionof
oferosions
erosionsas
asfollows
follows
∈∈P
ψψ==∪
B∈
P(E)
(E)}}, ,
∪{{εεΒΒ, ,B∈
with
withεεΒΒ(X)
(X)==ψ(B)
ψ(B) ifif XX⊇⊇B,
B, and
andεεΒΒ(X)
(X)==∅
∅otherwise
otherwise(dual
(dualresult
resultfor
forthe
thedilation).
dilation).
This
Thisrepresentation
representationgeneralises
generalisesG.
G.Matheron’s
Matheron’sone,
one,for
forthe
thetranslation
translationinvariant
invariantcase
case((
II,
II,14),
14),and
andextends
extendsitself
itselftotothe
thecomplete
completelattice
latticecase.
case.
•• Semi-groups:
Semi-groups:The
Thecomposition
compositionproduct
productof
oftwo
twodilations
dilations(resp.
(resp.erosions)
erosions)isisstill
stillaadilation
dilation
(resp.
erosion).
Indeed
(resp. erosion). Indeed
== ∪∪{{BB2(y)
, ,y∈
∪∪{{BB1(x)
, ,x∈X
}} == ∪∪{δ
[B
, ,x∈X
}}
δδB2δδB1(X)
11(x)]
(X)
(y)
y∈
(x)
x∈X
{δ
[B
(x)]
x∈X
B2
2
1
B2 B1
B2
hence
hence δδB2B2δδB1B1 ==
with
AA == δδB2((BB1))
δδA ;; εεB2εεB1 == εεA
with
1
A
B2 B1
A
B2
[[Semi-group
Semi-group⇒
no inverse
inverse⇔
loss ofof information.]
information.]
⇒ no
⇔ loss
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 5
Case
Case of
of Set
Set Translation
Translation Invariance
Invariance
•• Suppose
Suppose set
set EE equipped
equipped with
with aa translation
translation ττ.. The
The translation
translation invariant
invariant
operations
operationsψ:
ψ:P(E)→P(E)
P(E)→P(E)are
arecalled
calledττ-mappings
-mappings..
•• Then,
Then,the
thetwo
twobasic
basicdilations
dilationson
onP(E)
P(E)are
are
–– the
theMinkowski
MinkowskiAddition
Addition,,which
whichisisthe
theunique
uniqueτ-dilation,
τ-dilation,
–– the
theGeodesic
GeodesicDilation,
Dilation,which
whichisislimited
limitedto
toaagiven
givenmask
mask..
•• for
forall
allXX⊆⊆E,
E, introduce:
introduce:
1)
1)set
setXXbb,,translate
translateof
ofXXaccording
accordingto
tovector
vectorbb::
Origin
XXb =={x+b,
x
∈
X}
{x+b, x ∈ X}
v
b
Transposition
2)
or
reflected
of
XX::
2) set
setXX,,transposed
transposed
or
reflected
of
v
XX=={{-x
-x,,xx∈∈X}
X}
v
we
wehave:
have: xx∈∈ΒΒzz ⇔
⇔ zz--xx∈∈ΒΒ..Note
Notethat
thatBBisissymmetrical
symmetrical when
whenitit
isisequal
equalto
toits
itstransposed.
transposed.
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 6
Set
Set Dilation
Dilation and
and Minkowski
Minkowski Addition
Addition
τ-dilations
τ-dilations are
are called
called Minkowski
Minkowski
Additions.
Additions. Each
Each of
of them
them isis characterized
characterized
by
by the
the transform
transform BB of
of the
the origin,
origin, which
which
turns
turns out
out to
to be
be the
the basic
basic Structuring
Structuring
Element.
Element. By
By putting
putting δδBB(X)
(X) == X⊕B
X⊕B ,, we
we
have
have
X⊕
⊕
∈∈X}
X⊕
⊕BB== ∪
∪{{BBxx,, x∈
x∈
X}
==∪
∈∈X,
∈∈BB}}
∪{{xx++b,
b, x∈
x∈
X, b∈
b∈
==∪
∈∈BB}} ==BB⊕
∪{{XXbb,, b∈
b∈
⊕XX
•• The
The
from
fromz∈δ
z∈δBB(X)
(X) ⇔
⇔{{bb==z-x∈B
z-x∈Bv etet x∈X
x∈X}}
⇔
⇔ {{∃x:
∃x:xx∈∈BBzz∩
∩XX}}
we
wedraw
drawthat
thatthe
thedilate
dilateof
ofXXby
byBBisisthe
the
locus
locusof
ofthose
those v points
pointszzsuch
suchthat
thatthe
the
transposed
transposedset
setBBzzhits
hitsXX::
Structuring
element
Dilation
v
=={{z:z: BBz ∩∩XX≠≠∅}
δδB(X)
(X)
∅}
B
z
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 7
Set
Set Erosion
Erosion and
and Minkowski
Minkowski Subtraction
Subtraction
•• The
TheMinkowski
Minkowskisubtraction
subtractionof
ofXX
by
byBBis,
is,by
bydefinition,
definition,the
theerosion
erosion
X'B
X'Badjoint
adjointto
toX⊕B
X⊕B..
•• Geometrical
Geometricalinterpretation
interpretation
X'B
X'Bturns
turnsout
outto
tobe
bethe
thelocus
locusof
ofthe
the
positions
positionsof
ofthe
thecentre
centrezzof
ofthe
the
structuring
structuringelement
elementBBzzwhen
whenthe
the
latter
latterisisincluded
includedin
inXX::
εεB(X)
= X'
'
'BB=={{zz:: BBzz⊂⊂XX }}
B(X) = X'
•• ∩
∩--Representation
Representation
BBz ⊆
XX ⇔
∀∀b∈B:
b+z∈X
⊆
⇔
b∈B:
b+z∈X
z
⇔
⇔∀∀b∈B:
b∈B: z∈X
z∈X-b-b,,hence
hence
structuring element
Erosion
v
X'
'
X'
'BB==∩
∩{{XXbb,,bb∈∈BB}}
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 8
The
The two
two Dualities
Dualities
•• Adjunction,
Adjunction,already
alreadyseen,
seen,isis the
the duality
duality
XX⊆⊆Y'
'
⇔
X⊕
⊕
Y'
'BB
⇔
X⊕
⊕BB ⊆⊆YY X,
X,YY∈∈EE..
ItIt characterises
characterises the
the pairs
pairs "erosion-dilation".
"erosion-dilation". The
The adjoint
adjoint
term
term looks
looks like
like an
an inverse.
inverse. In
In particular,
particular, when
when X,
X, YY etet
BBare
areconvex
convexand
andsimilar,
similar,then
then
Dilate of X par B,
XX==Y'
Y'BB ⇔
⇔ X⊕
X⊕BB==Y.
Y.
similar to each other
•• Another
Anotherduality
dualityisisobtained
obtainedby
bytaking
takingthe
thecomplement
complement
i.e.
i.e.in
incase
caseof
ofan
anerosion,
erosion,by
byputting
putting::
cc
cc
ψψ(X)
=
(
X
'
B)
(X) = ( X ' B) ..v
v
cc
cc
cc
cc
Now,
∪
{X
bb,,b∈B}
Now,((XX '
'B)
B) ==[[∩
∩{(X
{(Xbb)) ,,b∈B}]
b∈B}] =
=
∪
{X
b∈B}
v
cc
cc
i.e.
ψ
(X)
=
(
X
'
B)
⊕
i.e.
ψ (X) = ( X ' B) == X⊕
X⊕
⊕BB..
The
Dilate of the same X v
Theoperation
operationdual,
dual,under
undercomplement,
complement,of
ofMinkowski
Minkowski
v
v B.
subtraction
by the transposed B
subtraction by
by BBisis Minkowski
Minkowskiaddition
additionby
by
B.
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 9
Algebraic
Algebraic Properties
Properties of
of Minkowski
Minkowski Operations
Operations
Distributivity
but only the inclusions
We have the following equalities
X ⊕ (B∩ B') ⊆ (X ⊕ B) ∩ (X ⊕ B')
X ⊕ (B∪ B') = (X ⊕ B) ∪ (X ⊕ B')
X ' (B∩ B') ⊇ (X ' B) ∪ (X ' B')
X ' (B∪ B') = (X ' B) ∩ (X ' B')
(X ∪ Z) ' B ⊇ (X ' B) ∩ (Z ' B)
(X ∩ Z) ' B = (X ' B) ∩ (Z ' B)
original
Extensivity
Ο∈B ⇒
original
X ⊆ (X ⊕ B)
(X ' B) ⊆ X
::
dilatation
dilatation
0∈ B
0 ∉B
x
Dilation is extensive and erosion anti-extensive if B contains the origin
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 10
Minkowski
Minkowski Addition
Addition by
by Convex
Convex sets
sets
••
••
n
In
Inthe
theEuclidean
Euclideanspace
spaceRRndenote
denoteby
byλB
λBthe
theset
setsimilar
similarof
ofBBby
byfactor
factorλ.
λ.
Then
Thenthe
thesemi-goup
semi-gouplaw:
law:
[([(XX⊕
λΒ
µΒ
⊕λΒ)
λΒ)
⊕µΒ)]
µΒ)]
⊕(λ
(λ++µ)
µ)ΒΒ
λΒ))⊕
µΒ)])] == XX⊕
isis satisfied
satisfied ifif and
and only
only ifif BB isis compact
compact convex
convex (x,y
(x,y ∈B
∈B =>
=> [x,y]∈B).
[x,y]∈B).
Moreover,
Moreover, ifif BB isis plane
plane and
and symmetrical,
symmetrical, itit isis equal
equal to
to aa product
product of
of
dilations
dilationsby
bysegments.
segments.
Practically,
Practically,the
thedilation
dilation(resp.
(resp.the
theerosion)
erosion)of
ofaaset
setXXby
bythe
theconvex
convex
structuring
structuringelement
elementλB
λBreduces
reducesto
toλλdilations
dilations(resp.
(resp.erosions)
erosions)by
bythe
the
structuring
structuringelement
elementB.
B.Iteration
Iterationacts
actsas
asaamagnification
magnificationfactor.
factor.
⊕
J. Serra
⊕
=
Ecole des Mines de Paris ( 2000 )
⊕
=
Course on Math. Morphology II. 11
Edge
Edge Effects
Effects
Most
Mostof
ofthe
thescenes
scenesunder
understudy
studyare
arerestrictions,
restrictions,to
to aa
rectangle
rectangleZ,
Z,of
ofaalarger
largerset
setX.
X.
•• Experimentally,
one
can
access
only
X∩Z,
or
Experimentally,
one
can
access
only
X∩Z,
or
cc
X∪Z
X∪Z ,,according
accordingto
tothe
thevalue
value00ou
ou 11that
thatone
onedecide
decide
to
togive
giveto
tothe
theoutside.
outside.Now,
Now,for
forBBsymmetrical
symmetrical
(X∩
∩
'
'
'
(X∩
∩Z)'
Z)'
'BB==(X'
(X'
'B)
B)∩
∩(Z'
(Z'
'B)
B) and
and
cc
cc
cc
(X∪Z
)⊕
B
=
(X⊕B)∪(Z
⊕B)
=
(X⊕B)∪(Z'B)
(X∪Z )⊕ B = (X⊕B)∪(Z ⊕B) = (X⊕B)∪(Z'B)
hence
hence
cc
⊕
'
⊕
'
[(X∪
∪
Z
)⊕
⊕B]
B]∩
∩(Z'
(Z'
'B)
B)== (X⊕
(X⊕
⊕B)
B)∩
∩(Z'
(Z'
'B)
B)
[(X∪
∪ Z )⊕
•• In
Inother
otherwords,
words,the
thetransforms
transforms(X⊕B)
(X⊕B)etet(X'B)
(X'B)are
are
correctly
correctlyknown
knowninside
inside mask
maskZZeroded
eroded itself
itselfby
byB.
B.
Worse,
Worse,when
whenwe
weconcatenate
concatenateaasequence
sequenceof
of
transformations
transformationswe
wesoon
soonreduce
reducethe
themask
maskto
to∅
∅!!
J. Serra
Ecole des Mines de Paris ( 2000 )
Initial set (X∩
∩Z)
Dilate (X⊕
⊕B) ∩ (Z'
'B)
Course on Math. Morphology II. 12
Standard
Standard Dilation
Dilation et
et Erosion
Erosion
•• To
To solve
solve the
the problem,
problem, we
we will
will reduce
reduce
progressively
progressively the
the structuring
structuring element
element when
when itit
comes
comes near
near the
the edge.
edge. We
We (progressively...)
(progressively...)
loose
loose translation
translation invariance,
invariance, but
but the
the result
result isis
provided
providedin
inthe
thewhole
wholemask
mask ZZ..
•• In
In such
such aa "standard"
"standard" approach,
approach, where
where the
the
structuring
structuringelement
elementx→B
x→Bxxbecomes
becomes x→B
x→Bxx∩
∩ZZ,,
dilation
dilationeteterosion
erosionare
arewritten
written
==(X⊕
⊕
B)
∩
ZZ
δδB(X)
(X)
(X⊕
⊕
B)
∩
B
εεB(X)
=={{x:
BBx∩
ZZ⊆⊆X∩
∩
ZZ}}
(X)
x:
∩
X∩
∩
x
B
The
Theduality
dualityfor
forthe
thecomplement
complementisisformalised
formalisedin
inZZ
ψ*(X)
ψ*(X)== ZZ\\ψψ(Z
(Z\X)
\X)
Which
the
Whichgives
givesfor
for
theerosion
erosionalgorithm
algorithm
v
cc
ZZ
εεB(X)
=Z
\
[δ
δ
(Z\X)]
=
[(X
∪
Z
)'
'
B]
∩
(X)
=Z
\
[δ
δ
(Z\X)]
=
[(X
∪
Z
)'
'
B]
∩
B
B
B
J. Serra
Ecole des Mines de Paris ( 2000 )
Initial set (X∩
∩Z)
∩Z)
Standard Dilation of (X∩
Course on Math. Morphology II. 13
Kernels
Kernels of
of the
the ττ-mappings
-mappings
When
When ψψ isis aa τ-mapping,
τ-mapping, its
its kernel
kernel vv isis defined
defined as
as the
the set
set of
of the
the Y⊆E
Y⊆E
whose
whose transform
transform contains
containsthe
theorigin
origin
vv=={{Y,
⊆⊆EE:: {o}
ψψ(Y)
Y,Y⊆
Y⊆
{o}∈∈ψ(Y)
ψ }}..
IfIf {ψ
{ψi}i} stands
stands for
for aa family
family of
of τ-applications,
τ-applications, of
of kernels
kernels vvi i ,, the
the sup
sup and
and the
the
inf
admit∪
∪vvi i and
and ∩
∩vvi i for
forrespective
respectivekernels
kernels..
infof
of the
theψψi i admit
••
In
In case
case of
of the
the Minkowski
Minkowski subtraction
subtraction by
by B,
B, the
the equality
equality B'B
B'B == {o}
{o}
implies
impliesthat
thatthe
thecorresponding
correspondingkernel
kernel w
wBBbe
be
(1)
w
Y, YY⊇⊇BB}}
(1)..
wBB=={{Y,
On
Onthe
theother
otherhand
hand{{ψψ increasing
increasing}} ⇔
⇔ {{ ΒΒ∈v,
∈v, A⊇Β
A⊇Β ⇒
⇒ ΑΑ∈v
∈v }} (2).
(2).
••
••
Theorem
Theorem::(G.Matheron,
(G.Matheron,1975)
1975)Every
Every increasing
increasingτ-mapping
τ-mappingψψon
onP(E),
P(E),of
of
kernel
kernelv,
v,isis the
thefollowing
followingunion
union of
of Minkowski
Minkowskisubtractions
subtractions
ψψ(X)
'
(X)==∪
∪{{X'
X'
'BB,,ΒΒ∈∈vv }}
[derives
[derivesfrom
fromEq.(1)
Eq.(1)and(2);
and(2);admits
admitsaadual
dualversion
versionfor
forthe
theadjoint
adjointdilation
dilation].].
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 14
Equivalence
Equivalence between
between Sets
Sets and
and Functions
Functions
A function can be viewed as a stack of decreasing sets. Each set is the
intersection between the umbra of the function and a horizontal plane.
Xλ (f) = { x∈
∈ E , f(x) ≥ λ }
⇔
f(x) = sup {λ
λ : x∈
∈ Xλ (f) }
Function
(∗
∗)
Stack of
sets
Sets
λ
Function
Function => Sets
Sets => Function
It is equivalent to say that f is upper semi-continuous or that the Xλ’s are
closed. Conversely, given a family {Xλ} of closed sets such that
λ ≥ µ ⇒ Xλ ⊆ Xµ and Xλ = ∩ {X
{ µ,µ<λ}
there exists a unique u.s.c. function f whose sections are the Xλ’s.
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 15
Dilation
Dilation and
and Erosion
Erosion by
by aa flat
flat structuring
structuring Element
Element
Definition : The dilation (erosion)
of a function by a flat structuring
element B is introduced as the
dilation (erosion) of each set Xf (λ)
by B.They are said to be planar .
This definition leads to the
following formulae :
( f⊕
⊕B) (x) = sup{ f(x-y), y∈
∈B }
( f'
'B) (x) = inf { f(x-y), - y∈
∈B }
grey levels
Dilate
60
50
Original
40
Eroded
30
20
Structuring
element
10
0
0
20
40
60
80
Space
• Erosion shrinks positive peaks. Peaks thinner that the structuring element
disappear. As well, it expands the valleys and the sinks.
• Dilation produces the dual effects.
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 16
Properties
Properties of
of the
the planar
planar operators
operators
• Erosion and dilation, with flat or non flat structuring elements, have
basically the same properties as those stated for sets.
• In addition,the use of flat structuring elements provides the three
following specific advantages
Commute under anamorphosis
An anamorphosis is an increasing
continuous mapping of the grey
level values.
e.g. Log (f⊕
⊕B) = (Log f)⊕
⊕B
anamorphosis
J. Serra
≠ anamorphosis
Stability
The class of the functions which take n
given values is preserved (any n-bit
image is tranformed into an n-bit image ).
Implementation
A transformation based on flat structuring
elements can be implemented either level
by level, or numerically.
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 17
Non
Non Planar
Planar Structuring
Structuring Elements
Elements
• Planar structuring elements can be viewed as a function of constant
level, equals to 0, and whose support is the structuring set. These
structuring elements can be generalised by introducing weights. The
resulting elements, no longer planar, are also called « non flat ».
Flat
element
Non flat
element
Support of
element
J. Serra
Ecole des Mines de Paris ( 2000 )
Support of
element
Course on Math. Morphology II. 18
Dilation
Dilation of
of Functions
Functions by
by non
non flat
flat Elements
Elements
Definition
Comparison with Convolution
Dilation and erosion of function f by
the (non flat) function h are
given by the relations
We can establish a parallelism
between the formulae of dilation
and of erosion and that of
convolution .
Sum
<=>
Sup or Inf
Product <=>
Sum
(f ⊕ h)(x) = sup [f(x-y) + h(y)]
y∈H
(f ' h)(x) = inf [f(x-y) - h(y)]
- y∈ H
convolution :
Remark:
Since the images under study
traduce physical
phenomena,
one shall take care to provide f
and f with consistent units.
J. Serra
h(x) * f(x) = ∑ f(x-y) . h(y)
y ∈H
dilation:
Ecole des Mines de Paris ( 2000 )
(f ⊕ h)(x) = sup[f(x-y) + h(y)]
y∈H
Course on Math. Morphology II. 19
Residues
Residues of
of Transformations
Transformations
Definition
• Le residue between two transformations ψ et ζ is their
difference
ρΨ,ζ(X) = ψ(X) \ ζ(X)
Set case :
Functions case :
ρΨ,ζ(X) = ψ(X) - ζ(X)
ψ
ψ
ζ
ζ
Résidue
Résidue
N. B. : Operations ψ and ζ may not be ordered .
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 20
Residues
Residues for
for Sets
Sets and
and Functions
Functions
Comment
Comment
•• The
Theresidues
residuesof
ofan
anincreasing
increasingtransformation
transformationare
arenot
notincreasing.
increasing.
Therefore,
Therefore,in
incase
caseof
ofnumerical
numericalfunctions,
functions,there
thereisisno
nolevel
levelby
bylevel
level
correspondence
correspondenceable
ableto
togenerate
generatethem,
them,as
asititcan
canbe
bedone
donefor
forflat
flat
dilations
dilationsor
orerosions.
erosions.
••
In
Inthe
thedigital
digitalapproach,
approach,ififwe
weput
put
∈∈EE,,f(x)
XXi (f)
(f)=={{x∈
x∈
f(x)≥≥ii}}
i
then
thenthe
thecorrespondence
correspondencebetween
betweenresidues
residues
of
offunctions
functionsand
andtheirs
theirsstacks
stacksof
of section
section
isisthe
thefollowing
following(digital
(digitalapproach)
approach)
≥0
XXi ((ff--gg))== ∪
k≥0
≥0]]
∪[X
[Xi + k (f)
(f)\\XXk + 1 (g)
(g) ,, k≥0
i
J. Serra
i+k
j
i
f
g
k+1
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 21
Morphological
Morphological Gradients
Gradients
The goal of gradients transformations is to highlight contours. In digital
morphology, three Beucher’s gradients based on the unit disc are
defined:
Gradient by erosion :
• It is the residue between the
identity and an erosion , i.e.:
for sets g- (X) = X / (X'B)
for functions g- (f) = f - (f'B)
Gradient by dilation :
• It is the residue between a
dilation and the identity, i.e. :
for sets g+ (X) = (X⊕B) / X
for functions g+ (f ) = (f⊕B) - f
Original
Original
Erosion
Gradient
J. Serra
Ecole des Mines de Paris ( 2000 )
Dilation
Gradient
Course on Math. Morphology II. 22
Morphological
Morphological Gradients
Gradients (II)
(II) and
and Laplacian
Laplacian
Symmetrical gradient :
• It is the residue between a
dilation and an erosion
for sets g (X) = (X⊕B) / (X'B)
for functions g (f) = (f⊕B) - (f'B)
Laplacian :
• It is the residue between the
gradients by dilation and
erosion, for functions
L(f) = g+ (f ) - g - (f)
Erosion
Original
Erosion
Dilation
Original
Dilation
Laplacian
Gradient
Note: These notions correspond the "classical" notions of gradient and laplacian
(if they exist), in the limit, when the radius of disc tends towards zero.
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 23
References
References
On
On Set
Set Dilation
Dilation::
•• H.Minkowski
H.Minkowski {MIN03},
{MIN03}, in
in 1901,
1901, defined
defined and
and studied
studied set
set dilation
dilation as
as itit isis
presented
presented in
in chapter
chapter II.
II. However,
However, he
he did
did not
not introduce
introduce the
the concept
concept of
of an
an
erosion,
erosion, which
which was
was defined
defined by
by Hadwiger
Hadwiger {HAD57},
{HAD57}, in
in 1957.The
1957.The study
study of
of
the
thespecific
specificproperties
propertiesof
ofbinary
binarydilations
dilationsas
asaafunction
functionof
ofthe
thegeometry
geometryof
ofthe
the
structuring
structuringelement
elementdates
datesfrom
fromthe
theearly
early70's
70's{HAA67},{SER69},{SER72}.
{HAA67},{SER69},{SER72}.
On
On Numerical
Numerical Dilation
Dilation::
•• The
The extension
extension to
to numerical
numerical functions
functions began
began with
with {SER75}
{SER75} {ROS76},
{ROS76},
{MEY77},
{MEY77}, and
and was
was completed
completed by
by {SER82,ch12}
{SER82,ch12} (semi-continuous
(semi-continuous case,
case,
flat
flat structuring
structuring elements)
elements) and
and {STE86}
{STE86} (filters).The
(filters).The properties
properties of
of planar
planar
mappings
mappingshave
havebeen
beenstudied
studiedin
inlength
lengthin
in{SER82},
{SER82},{HEI91},{SOI92b}.
{HEI91},{SOI92b}.
On
On Adjunction
Adjunction::
•• Duality
Duality between
between erosion
erosion and
and dilation
dilation appears
appears for
for the
the first
first time
time in
in E.Gallois's
E.Gallois's
work
work (see
(see {BIR84}).
{BIR84}). ItIt was
was rediscovered
rediscovered by
by J.Serra
J.Serra in
in {SER88,ch.1},
{SER88,ch.1}, who
who
found
foundalso
alsothe
therepresentation
representationtheorems,
theorems,and
andenriched
enrichedof
ofvarious
variousproperties
propertiesby
by
H.Heijmans
H.Heijmansand
andCh.Ronse
Ch.Ronsein
in{HEI90}.
{HEI90}.
J. Serra
Ecole des Mines de Paris ( 2000 )
Course on Math. Morphology II. 24