Professional Documents
Culture Documents
Morphing
B
A
z = (z1,z2)
(A)z B̂
Morphological Image Processing
Basic Morphological Operations
• Dilation – improves the connectivity thereby
reducing the holes
• Erosion - separates the object boundaries
thereby expanding the holes
• Opening – Erosion followed by Dilation
• Closing – Dilation followed by Erosion
All operations require a structuring element
Structuring Elements
• Application
specific
structuring
elements
created by
the user
Structuring Element
The two most common structuring elements (given a Cartesian grid)
are the 4-connected and 8-connected sets, N4 and N8. They are
illustrated in Figure .
Definition of Structuring Element(SE):
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1
26
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1 0
4/13/20 27
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1 0 1
4/13/20 28
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1 0 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1 0 1 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1 0 1 1 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1 0 1 1 1 1 1
Example for Dilation
Input image 1 0 0 0 1 1 1 0 1 1
Structuring Element 1 1 1
Output Image 1 0 1 1 1 1 1 1
Dilation with Structuring Elements
Structuring
Element (B)
X difference
dilation
B
Dilation Example
1) Literal translation
Dilation
Dilation
Structuring Elements, Hits, Fits and Misses
B Structuring Element
0 0 1 1 1 1 1 1 0 0 0 0 0 1 0
0 0 1 1 1 1 1 1 1 0 0 0 1 1 1
0 0 1 1 1 1 1 A1 1 1 1 0 0 1 0
0 0 0 0 0 1 1 1 1 1 1 0 Structuring
Element 2
0 0 0 0 0 0 0 0 0 0 0 0
Dilation
Dilation of image f by structuring element s is
given by f s
The structuring element s is positioned with its
origin at (x, y) and the new pixel value is
determined using the rule:
1 if s hits f
g ( x, y )
0 otherwise
Dilation Example
Original Image Processed Image
Structuring Element
Dilation Example
Original Image Processed Image With Dilated Pixels
Structuring Element
Dilation Example 1
Structuring element
What Is Dilation For?
Dilation can repair breaks
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 0 1 1 1 1 0
0 0 0 1 0 0 0
0 0 0 1 1 1 0
0 0 0 1 1 0 0
0 0 0 1 1 1 1
0 0 1 1 1 1 0
0 0 1 1 1 1 1 0 0 1 1 1 0 0
0 0 1 1 1 1 1 0 1 0 1 0 1 0
0 1 1 1 1 1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0
Input
(b) The erosion using structuring element
1 1
1
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 1 1 0 0 0
0 0 1 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
(c ) Dilate with the structuring element
11 1
0 1
Reflected structuring element
1 0
1 11
Result of dilation 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 1 1 0 0 0 0 1 1 0 0 0
0 0 0 1 1 0 0 0 0 0 1 0 0 0
0 0 0 1 1 0 0
0 0 0 1 1 1 0
0 0 1 1 1 1 0
0 0 1 1 1 1 1
0 0 1 1 1 0 0
0 0 1 1 1 1 1
0 1 0 1 0 1 0
0 1 1 1 1 1 1
0 0 0 0 0 0 0
0 1 1 1 1 1 1
Input
(d) Erode with structuring element 1
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 0 0 1 1 0 0 0 0 1 1 0 0 0
0 0 0 1 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 0 0
0 0 0 0 0 0 0 0 0 1 1 1 1 0
0 0 1 1 1 0 0
0 1 0 1 0 1 0
0 0 0 0 0 0 0