Chapter 9 Morphological Image Processing Chapter 9 Morphological Image Processing

pancakesnightmuteΤεχνίτη Νοημοσύνη και Ρομποτική

5 Νοε 2013 (πριν από 3 χρόνια και 9 μήνες)

109 εμφανίσεις

Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Question
Question
What is Mathematical Morphology ?
An (imprecise) Mathematical Answer
An (imprecise) Mathematical Answer
A mathematical tool for investigating geometric structure in
binary
and
grayscale
images.
Shape Processing and Analysis
Shape Processing and Analysis
Visual perception requires transformation of images so as to
make explicit particular
shape information
.
Goal:
Distinguish meaningful shape information from
irrelevant one.
The vast majority of shape processing and analysis techniques
are based on designing a
shape operator
which satisfies
desirable properties.
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Morphological Operators
Morphological Operators
Erosions
and
dilations
are the most elementary operators of
mathematical morphology.
More complicated
morphological operators
can be designed by
means of combining erosions and dilations.
Some History
Some History
George Matheron(1975)
Random Sets and Integral Geometry,
John Wiley.
Jean Serra(1982)
Image Analysis and Mathematical
Morphology, Academic Press.
PetrosMaragos (1985)
A Unified Theory of Translations-
Invariant Systems with Applications to Morphological Analysis and
Coding of Images, Doctoral Thesis, Georgia Tech.
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: DILATION
Chapter 9
Morphological Image Processing: DILATION
B = structuringelement
NOTE:the flippingof the
structuringelementisincludedin
analogytoconvolution. Notall
Authorsperformit.
Set of allpointsz
suchthatB,
flippedand
translatedbyz,
hasa non-empty
intersectionwithA
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: DILATION
Chapter 9
Morphological Image Processing: DILATION
A possiblealternative: linearlowpassfiltering+
thresholding
Example: bridgingthe gaps
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: EROSION
Chapter 9
Morphological Image Processing: EROSION
Set of allpoints
zsuchthatB,
translatedbyz,
isincludedin A
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Example: eliminatingsmallobjects
NOTE: whiteobjectson black background (oppositewrtprev.
slides)
NOTE: the final dilationwillNOT yieldin generalthe exact
shapeof the originalobjects
Chapter 9
Morphological Image Processing: EROSION
Chapter 9
Morphological Image Processing: EROSION
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Example:
Chapter 9
Morphological Image Processing: EROSION
Chapter 9
Morphological Image Processing: EROSION
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Openingand closing
OPENING iserosionfollowedbydilation
CLOSING isdilationfollowedbyerosion
Chapter 9
Morphological Processing: OPENING, CLOSING
Chapter 9
Morphological Processing: OPENING, CLOSING
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: OPENING
Chapter 9
Morphological Image Processing: OPENING
A differentformulation:
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: CLOSING
Chapter 9
Morphological Image Processing: CLOSING

})(|){(〈〉≠∩=ABB
zz
A differentformulation:
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
A property:
Erosionand Dilation
Openingand Closing
are dualoperatorswrtset complementationand
reflection:
BABA
BABA
CC
CC
ˆ
)(
ˆ
)(
=•
⊕=
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: EXAMPLE
Chapter 9
Morphological Image Processing: EXAMPLE
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: EXAMPLE
Chapter 9
Morphological Image Processing: EXAMPLE
Gapsexistin the
output;
Betterresultswitha
smallerSE
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Boundaryextraction: example
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Regionfilling:
AXX
ABXX
doXXwhile
PX
kF
C
kk
kk
∪=
∩⊕=

=


)(
1
1
0
The dilationwouldfillthe
wholearea wereitnotfor
the intersectionwithA
C
￿
￿￿￿Conditionaldilation
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: SKELETONS
Chapter 9
Morphological Image Processing: SKELETONS
Maximumdisk: largestdisk includedin A, touching
the boundaryof A at twoor more differentplaces
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphological Image Processing: SKELETONS
Chapter 9
Morphological Image Processing: SKELETONS
))...)(((:BBBAkBADefine
=
K
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: Example of skeleton
Chapter 9
Morphology: Example of skeleton
Itisnotgrantedthat
the resultingskeleton
is
maximallythin,
connected,
minimallyeroded.
Othertechniques
exist; e.g., the Medial
AxisTransform, or
conditionalthinning
algorithms.
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Bwmorph
Matlab
command:
options
Chapter 9
Morphological Image Processing
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Dilationand erosionof animagef(x,y)bya structuringelement
b(x,y).
NOTE: b and f are no longersets, butfunctionsof the coordinates
x,y.In a simple1-D case:
}&)(|)()(max{))((
bf
DxDxsxbxsfsbf∈∈−+−=⊕
Likein convolution, wecan ratherhaveb(x) slide over f(x):
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Similarlyforerosion:
}&)(|)()(min{))((
bf
DxDxsxbxsfsbf


+

+
=
Note: s-xhasbecomes+xin ordertodefinea duality
betweendilationand erosion:
bfbf
CC
ˆ
)(⊕=
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
In twodimensions:
}),(&)(),(|),(),(min{
),)((
bf
DyxDytxsyxbytxsf
tsbf
∈∈++−++=
=
Effectsof erosion(whenthe structuringelementhasallpositive
entries):
•The output imagetendstobedarkerthanthe input one
•Brightdetailsin the input imagehavingarea smallerthanthe s.e.
are lessened
The
opposite
for
dilation
.
}),(&)(),(|),(),(max{
),)((
bf
DyxDytxsyxbytxsf
tsbf
∈∈−−−−−=
=

Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Structuringelement:
“flat-top”, a
parallelepipedwithunit
heightand size5x5
pixels
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Openingand closingof animagef(x,y)bya structuringelementb(x,y)
havethe sameformastheirbinarycounterpart:
bbfbfbbfbf)()(

=


=

Geometricinterpretation:
Viewthe imageasa 3-D surfacemap, and suppose wehavea
sphericals.e.
Opening: rollthe sphereagainstthe undersideof the surface,
and take the highestpointsreachedbyanypartof the sphere
Closing: rollthe sphereon topof the surface, and take the
lowestpointsreachedbyanypartof the sphere
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Sames.e. asin Fig.9.29.
Note the decreasedsizeof the smallbright(opening) or dark (closing)
details;
withno appreciableeffecton the darker(opening) or brighter(closing)
details
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Morphologicalsmoothing: openingfollowedbyclosing
(whataboutdoingviceversa?) (Sames.e. asin Fig.9.29)
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Morphologicalgradient: differencebetweendilationand
erosion(Sames.e. asin Fig.9.29)
)()(bfbfg


=
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Top-hattransformation: differencebetweenoriginaland
opening(whataboutoriginaland closing?) (Sames.e. asin
Fig.9.29)
)(bffg

=
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Texturesegmentation: (forthisspecificproblem)
1.Closingwitha largerand largers.e. untilthe smallparticles
disappear
2.Openingwitha s.e. largerthanthe gapsbetweenlarge
particles
3.Gradient￿separationcontour
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Images ©2002 Gonzalez &
Woods
DigitalImageProcessing
Chapter 9
Morphology: gray-level images
Chapter 9
Morphology: gray-level images
Granulometry: (forthisspecificproblem)
1.Openingwitha smalls.e. and differencewrtoriginalimage
(i.e., top-hattransform)
2.Repeatwithlargerand largers.e.
3.Buildhistogram