2. Preview
Morphology 形態學
About the form and structure of animals and
plants
Mathematical morphology
Using set theory
Extract image component
Representation and description of region shape
3. Preview (cont.)
Sets in mathematical morphology represent
objects in an image
Example
Binary image: the elements of a set is the
coordinate (x,y) of the pixels, in Z2
Gray-level image: the element of a set is the
triple, (x, y, gray-value), in Z3
4. Outline
Preliminaries – set theory
Dilation and erosion
Opening and closing
Hit-or-miss transformation
Some basic morphological algorithms
Extensions to gray-scale images
Binary
images
5. Preliminaries – set theory
A be a set in Z2.
a = (a1, a2) is an element of A.
a is not an element of A
Null (empty) set:
A
a
A
a
6. Set theory (cont.)
Explicit expression of a set
Example:
n
a
a
a
A ,...,
, 2
1
elements
set
for
condition
element
A
D
d
d
w
w
C
for
,
1
2
7. Set operations
A is a subset of B: every element of A is an element
of another set B
Union 聯集
Intersection 交集
Mutually exclusive
B
A
B
A
C
B
A
C
B
A
19. Application of erosion:
eliminate irrelevant detail
original image
Squares of size
1,3,5,7,9,15 pels
erosion
Erode with
13x13 square
dilation
20. Dilation and erosion are duals
c
z
c
A
B
z
B
A )
(
)
(
c
c
z A
B
z )
(
)
(
c
z A
B
z
)
ˆ
(
A
B
z
B
A z
B
Ac ˆ
23. Outline
Preliminaries
Dilation and erosion
Opening and closing
Hit-or-miss transformation
Some basic morphological algorithms
Extensions to gray-scale images
24. Opening
Dilation: expands image w.r.t structuring
elements
Erosion: shrink image
erosion+dilation = original image ?
Opening= erosion + dilation
B
B
A
B
A
)
(
28. Closing (cont.)
Find contour Fill in contour
Smooth the object contour, fuse narrow breaks and long
thin gulfs, eliminate small holes, and fill in gaps
連接小斷點,消除小空洞,填補空隙
29. Properties of opening and
closing
Opening
Closing
A
B
A of
(subimage)
subset
a
is
(i)
B
D
B
C
C
of
subset
a
is
then
D,
of
subset
a
is
If
(ii)
B
A
B
B
A
)
(
(iii)
B
A
A
of
(subimage)
subset
a
is
(i)
B
D
B
C
C
of
subset
a
is
then
D,
of
subset
a
is
If
(ii)
B
A
B
B
A
)
(
(iii)
Open後變小
close後變大
重複做open等於做一次open
重複做close等於做一次close
35. Outline
Preliminaries
Dilation and erosion
Opening and closing
Hit-or-miss transformation
Some basic morphological algorithms
Extensions to gray-scale images
36. Basic morphological algorithms
Extract image components that are useful in the
representation and description of shape
Boundary extraction
Region filling
Extract of connected components
Convex hull
Thinning
Thickening
Skeleton
Pruning
37. Region filling
How?
Idea: place a point inside the region, then
dilate that point iteratively
,...
3
,
2
,
1
,
)
( 1
k
A
B
X
X c
k
k
p
X
0
Until 1
k
k X
X
Bound the growth
40. Extraction of connected
components
找到連通部分
Idea: start from a point in
the connected component,
and dilate it iteratively
,...
3
,
2
,
1
,
)
( 1
k
A
B
X
X k
k
p
X
0
Until 1
k
k X
X
43. Skeletons 骨架
Set A Maximum disk
1. The largest disk
Centered at a pixel
2. Touch the boundary
of A at two or more
places
Recall: Balls of erosion!
How to define a
Skeletons?