You are on page 1of 36

Morphological Image Processing

Introduction

► Morphology: a branch of biology that deals with the form


and structure of animals and plants

► Morphological image processing is used to extract image


components for representation and description of region
shape, such as boundaries, skeletons, and the convex hull

2/27/2014 2
Preliminaries (1)

► Reflection

 , is defined as
The reflection of a set B, denoted B
 ==
B {w | w −b, for b ∈ B}

► Translation

The translation of a set B by point z = ( z1 , z2 ), denoted ( B) Z ,


is defined as
( B) Z ==
{c | c b + z , for b ∈ B}

2/27/2014 3
Example: Reflection and Translation

2/27/2014 4
Preliminaries (2)

► Structure elements (SE)

Small sets or sub-images used to probe an image under study for


properties of interest

2/27/2014 5
Examples: Structuring Elements (1)

origin

2/27/2014 6
Examples: Structuring Elements (2)
Accommodate the
entire structuring
elements when its Origin of B visits
origin is on the every element of A
border of the
original set A
At each location of
the origin of B, if B
is completely
contained in A,
then the location is
a member of the
new set, otherwise
it is not a member
of the new set.

2/27/2014 7
Erosion

With A and B as sets in Z 2 , the erosion of A by B, denoted A B,


defined
=
A B { z | ( B) Z ⊆ A}
The set of all points z such that B, translated by z , is contained by A.

A { z | ( B) Z ∩ A =
B= ∅} c

2/27/2014 8
Example
of
Erosion
(1)

2/27/2014 9
Example
of
Erosion
(2)

2/27/2014 10
Dilation

2
With A and B as sets in Z , the dilation of A by B,
denoted A ⊕ B, is defined as

{ ()
 ∩A≠∅
A ⊕ B= z | B
z
}
 and A
The set of all displacements z , the translated B
overlap by at least one element.

=
A ⊕B { ()
z |  B

 ∩ A ⊆ A
z  }
2/27/2014 11
Examples of Dilation (1)

2/27/2014 12
Examples of Dilation (2)

2/27/2014 13
Duality

► Erosion and dilation are duals of each other with respect to


set complementation and reflection

( A − B) 
=A ⊕ B
c c

and
( A ⊕ B) 
=Ac − B
c

2/27/2014 14
Duality

► Erosion and dilation are duals of each other with respect to


set complementation and reflection

{z | ( B )
( A − B=
) ⊆ A}
c c
Z

{z | ( B ) ∅}
c
= Z
∩A =
c

= {z | ( B ) Z
∩ Ac ≠ ∅}

= Ac ⊕ B

2/27/2014 15
Duality

► Erosion and dilation are duals of each other with respect to


set complementation and reflection

{ ( ) ∩ A ≠ ∅}
c
( A=
⊕ B) 
c
z| B
Z

{ ()
= z |  ∩A =
B
Z
∅}
c


= Ac − B

2/27/2014 16
Opening and Closing

► Opening generally smoothes the contour of an object,


breaks narrow isthmuses, and eliminates thin protrusions

► Closing tends to smooth sections of contours but it


generally fuses narrow breaks and long thin gulfs,
eliminates small holes, and fills gaps in the contour

2/27/2014 17
Opening and Closing

The opening of set A by structuring element B,


denoted A  B, is defined as
A  B = ( A − B) ⊕ B

The closing of set A by structuring element B,


denoted AB, is defined as
AB = ( A ⊕ B ) − B

2/27/2014 18
Opening

The opening of set A by structuring element B,


denoted A  B, is defined as
=A  B  {( B ) Z | ( B ) Z ⊆ A}

2/27/2014 19
Example: Opening

2/27/2014 20
Example: Closing

2/27/2014 21
2/27/2014 22
Duality of Opening and Closing

► Opening and closing are duals of each other with respect


to set complementation and reflection

( AB ) )
= (A  B
c c

( A  B) )
= ( A B
c c

2/27/2014 23
The Properties of Opening and Closing

► Properties of Opening
(a) A  B is a subset (subimage) of A
(b) if C is a subset of D, then C  B is a subset of D  B
(c) ( A  B)  B = A  B
► Properties of Closing

(a) A is subset (subimage) of AB


(b) If C is a subset of D, then C 
B is a subset of D B
B) B = A B
(c) ( A
2/27/2014 24
2/27/2014 25
The Hit-or-Miss
Transformation

if B denotes the set composed of


D and its background,the match
(or set of matches) of B in A,
denoted A ∗ B,
A * B = ( A − D ) ∩  Ac − (W − D ) 

B = ( B1 , B2 )
B1 : object
B2 : background
A∗ B = ( A − B1 ) ∩ ( Ac − B2 )
2/27/2014 26
Some Basic Morphological Algorithms (1)

► Boundary Extraction
The boundary of a set A, can be obtained by first eroding A
by B and then performing the set difference between A and
its erosion.

β ( A) =A − ( A − B )

2/27/2014 27
Example 1

2/27/2014 28
Example 2

2/27/2014 29
Some Basic Morphological Algorithms (2)

► Hole Filling
A hole may be defined as a background region surrounded
by a connected border of foreground pixels.

Let A denote a set whose elements are 8-connected


boundaries, each boundary enclosing a background region
(i.e., a hole). Given a point in each hole, the objective is to
fill all the holes with 1s.

2/27/2014 30
Some Basic Morphological Algorithms (2)

► Hole Filling
1. Forming an array X0 of 0s (the same size as the array
containing A), except the locations in X0 corresponding to
the given point in each hole, which we set to 1.

2. Xk = (Xk-1 + B) ∩Ac k=1,2,3,…

Stop the iteration if Xk = Xk-1

2/27/2014 31
Example

2/27/2014 32
2/27/2014 33
Some Basic Morphological Algorithms (3)

► Extraction of Connected Components


Central to many automated image analysis applications.

Let A be a set containing one or more connected


components, and form an array X0 (of the same size as the
array containing A) whose elements are 0s, except at each
location known to correspond to a point in each connected
component in A, which is set to 1.

2/27/2014 34
Some Basic Morphological Algorithms (3)

► Extraction of Connected Components


Central to many automated image analysis applications.

X k= ( X k −1 + B) ∩ A
B : structuring element

until X k = X k -1

2/27/2014 35
2/27/2014 36

You might also like