CH5 Morphological Binary Image Proc
CH5 Morphological Binary Image Proc
MORPHOLOGICAL BINARY
IMAGE PROCESSING
Eng. Hamza Hassan Karshe
Faculty of Mechanical Engineering
SOMALI NATIONAL UNIVERSITY
Gaheyr Campus
Images taken from:
R. Gonzalez and R. Woods. Digital Image Processing, Prentice Hall, 2008.
Digital Image Processing course by Brian Mac Namee, Dublin Institute of Technology.
1
MACHINE VISION
Morphological Binary Image
Processing
2
MORPHOLOGICAL BINARY IMAGE
PROCESSING
Morphological image processing (or morphology) describes a range
of image processing techniques that deal with the shape (or
morphology) of features in an image.
Morphological operations are typically applied to remove
imperfections introduced during segmentation or we can say
that morphology is a branch of biology that deals with the forms
and the structure of animals and plants.
3
MORPHOLOGICAL BINARY IMAGE
PROCESSING
Known as mathematical morphology
4
Basic Set Theory
5
Logic Operations
6
Example: Logic Operations
7
Structuring element (SE)
Structuring element (s.e.) is a shape, used to probe or interact
with a given image, with the purpose of drawing conclusions on
how this shape fits or misses the shapes in the image.
It is typically used in morphological operations, such as
dilation, erosion, opening, and closing, as well as the hit-or-miss
transform.
8
Basic Morphological Operations
• Erosion
• Dilation
9
How structuring elements are
used in morphology
10
Erosion
Does the structuring element fit the set?
Erosion: set of points z, such that structuring
element (S.E.) B translated by z fits fully
inside A.
A B {z|(B)z A}
al Set
gin
Ori
r ing Find me all the
shrink the object
u
t ruct ent locations, where
S em
El S.E translating by
z, will fit inside
the original shape
fully. 11
Erosion
12
Erosion
13
Erosion
14
Erosion
15
Dilation
17
Dilation
18
Dilation
B = structuring element
A B {z|( Bˆ )z A Φ} 19
Dilation : Bridging gaps
20
Useful
• Erosion
– removal of structures of certain shape and
size, given by SE
• Dilation
– filling of holes of certain shape and size,
given by SE
21
Combining erosion and
dilation
WANTED:
– remove structures / fill holes
– without affecting remaining parts
SOLUTION:
• combine erosion and dilation
• (using same SE)
22
Combining Erosion & Dilation :
eliminating irrelevant detail and
restoring
Example 1:
A B ( A B) B
Thus, the opening A by B is the erosion of A by
B, followed by dilation of the result by B.
25
Example 2:
Opening
26
Example 3:
Opening
27
Opening
A B ( A B) B
A B {( B ) z | ( B) z A}
28
Example 4: Opening
29
Closing
The closing of set A by structuring element B,
denoted A• B, is defined as:
A B ( A B) B
Dilation of A by B, followed by erosion of the
result by B.
30
Example 5:
Closing
31
Example 6:
Closing
32
Example 7: Closing
34
Properties
Opening
(i) AB is a subset (subimage) of A
(ii) If C is a subset of D, then C B is a subset of D B
(iii) (A B) B = A B
Closing
(i) A is a subset (subimage) of AB
(ii) If C is a subset of D, then C B is a subset of D B
(iii) (A B) B = A B
36
Application:
Filtering Operation
37
Some Basic Morphological Algorithms:
Boundary Extraction
The boundary of a set A, denoted by β(A),can be obtained by first
eroding A and B and then performing the set difference between A and
its erosion.
( A) A ( A B)
and B is a structuring element.
38
Example
39
Hole filling/Region Filling
c
X k ( X k 1 B) A k 1,2,3,...
40
Example
41
Thinning
A B A ( A B)
c
A ( A B)
46
K
Skeletons S ( A) S k ( A)
k 0
S k ( A) ( A kB ) ( A kB ) B
K max{k | ( A kB) }
K
A ( S k ( A) kB )
k 0
48
49
51
52
53
54
55