Documente Academic
Documente Profesional
Documente Cultură
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Question
What is Mathematical Morphology ?
An (imprecise) Mathematical Answer
A mathematical tool for investigating geometric structure in
binary and grayscale images.
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
Chapter 9
Morphological Image Processing
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
George Matheron (1975) Random Sets and Integral Geometry,
John Wiley.
Jean Serra (1982) Image Analysis and Mathematical
Morphology, Academic Press.
Petros Maragos (1985) A Unified Theory of TranslationsInvariant Systems with Applications to Morphological Analysis and
Coding of Images, Doctoral Thesis, Georgia Tech.
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: DILATION
B = structuring element
NOTE:the flipping of the
structuring element is included in
analogy to convolution. Not all
Authors perform it.
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: DILATION
Example: bridging the gaps
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: EROSION
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: EROSION
Example: eliminating small objects
NOTE: white objects on black background (opposite wrt prev.
slides)
NOTE: the final dilation will NOT yield in general the exact
shape of the original objects
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: EROSION
Example:
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Processing: OPENING, CLOSING
Opening and closing
OPENING is erosion followed by dilation
CLOSING is dilation followed by erosion
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: OPENING
A different formulation:
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: CLOSING
A different formulation:
= U{( B) z | ( B) z A }
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
A property:
Erosion and Dilation
Opening and Closing
are dual operators wrt set complementation and
reflection:
( A B) C = AC B
( A B) C = AC o B
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: EXAMPLE
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: EXAMPLE
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Boundary extraction: example
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Region filling:
X0 = P
while X k X k 1 do
X k = ( X k 1 B) AC
XF = Xk A
The dilation would fill the
whole area were it not for
the intersection with AC
Conditional dilation
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing: SKELETONS
Maximum disk: largest disk included in A, touching
the boundary of A at two or more different places
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphological Image Processing
Bwmorph
Matlab
command:
options
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Dilation and erosion of an image f(x,y) by a structuring element
b(x,y).
NOTE: b and f are no longer sets, but functions of the coordinates
x,y.
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Similarly for erosion:
(f
(f
b) C = f C b
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
In two dimensions:
( f b)( s, t ) =
= max{ f ( s x, t y ) + b( x, y ) | ( s x), (t y ) D f & ( x, y ) Db }
(f
b)( s, t ) =
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Structuring element:
flat-top, a
parallelepiped with unit
height and size 5x5
pixels
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Opening and closing of an image f(x,y) by a structuring element b(x,y)
have the same form as their binary counterpart:
f ob = ( f
b) b
f b = ( f b)
Geometric interpretation:
View the image as a 3-D surface map, and suppose we have a
spherical s.e.
Opening: roll the sphere against the underside of the surface,
and take the highest points reached by any part of the sphere
Closing: roll the sphere on top of the surface, and take the
lowest points reached by any part of the sphere
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Morphological smoothing: opening followed by closing
(what about doing viceversa?) (Same s.e. as in Fig.9.29)
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Morphological gradient: difference between dilation and
erosion (Same s.e. as in Fig.9.29)
g = ( f b) ( f
b)
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Top-hat transformation: difference between original and
opening (what about original and closing?) (Same s.e. as in
Fig.9.29)
g = f ( f o b)
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Texture segmentation: (for this specific problem)
1. Closing with a larger and larger s.e. until the small particles disappear
2. Opening with a s.e. larger than the gaps between large particles
3. Gradient separation contour
Gianni Ramponi
University of Trieste
http://www.units.it/ramponi
Chapter 9
Morphology: gray-level images
Granulometry: (for this specific problem)
1. Opening with a small s.e. and difference wrt original image
(i.e., top-hat transform)
2. Repeat with larger and larger s.e.
3. Build histogram