Morphological Image Processing Basics of Set Theory Additional

Morphological Image Processing
Basics of Set Theory
A
B
1
A and c B
A and c B
2
chapt09p1.sxi
chapt09p1.sxi
z
z for all a
a
A
z
A
z B
B
A
b for all b B
w w
A
w w
Dilation
Additional Set Operations for Images
B
A Bc
c c
A
w w
A B
A or c B
c c
A B
Ac
chapt09p1.sxi
c c
A B
A
A
a
a
Mathematical morphology – tools based on set theory that are
useful in the representation and description of shape
We will start with binary images; each pixel is either 0 or 1, on or
off, black or white; however, see below...
We will consider sets that are collections of pixels
The concept of “pixel value” is not nearly as important as “set
membership”
These sets will “live” in a “universe” consisting of all the pixels in
an image
Dilation – the set of all pixels z such that the reflection of B
translated by z overlaps with A by at least one pixel
B is called the structuring element
Dilation tends to make sets bigger
Dilation fills in gaps smaller than the structuring element
Application: fill in gaps in characters in a poorly scanned
document
3
chapt09p1.sxi
4
Erosion
B
B
chapt09p1.sxi
5
z
A
Erosion – the set of all pixels z such that B translated by z is
contained entirely in A
Erosion tends to make sets smaller
Erosion completely eliminates sets smaller than the structuring
element
Erosion removes protrusions smaller than the structuring element
Duality relationship – dilation and erosion are duals with respect
to complementation and reflection
Application: remove all components smaller than a given size
from a segmented image
6
chapt09p1.sxi
Opening
7
chapt09p1.sxi
z
B
B
B
B
A
A B
A B
Erosion Examples
chapt09p1.sxi
z B
B
A
Dilation Examples
z
A
“ Rolling ball” analogy; ball rolls on inside of set
Smooths contours
Breaks narrow ithmuses
Eliminates thin protrusions
8
Closing
B
$
B
B
Ac B
“ Rolling ball” analogy; ball rolls on outside of set
Fuses narrow breaks and long thin gulfs
Eliminates small holes
Fills gaps
Duality relationship – opening and closing are duals with respect
to complementation and reflection
9
chapt09p1.sxi
10
chapt09p1.sxi
Closing Example
chapt09p1.sxi
c
A
#
!
A B
"
!
A B
"
B
%
Opening Example
Opening Example
B
B
B
B
11
chapt09p1.sxi
12
B
A
B1
Ac
.
A
/
X
.
W
-
Ac
,
X
+
A
)
B
*
A
)
B
(
Hit-or-miss Transformation
'
Closing Example
B2
&
&
&
&
B
13
chapt09p1.sxi
Hit-or-miss Transformation
chapt09p1.sxi
15
chapt09p1.sxi
Used to search for match to a particular shape
Also used in thinning and thickening
B actually represents a pair of structuring elements, B1 and B2
B1 and B2 will never be the same set (why?)
14