Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

MORPHOLOGY REPRESENTATION

AND SEGMENTATION
unit 2

Dr. Saranya.K.C
SENSE
Dr.Saranya.K.C
VIT
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

Dr.Saranya.K.C
VIT
Preliminaries (1)

• Reflection

The reflection of a set B, denoted Bµ, is defined as


µ  {w | w  b, for b  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}

Dr.Saranya.K.C
VIT
Example: Reflection and Translation

Dr.Saranya.K.C
VIT
Preliminaries (2)

• Structure elements (SE)

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


for properties of interest

 Fit
 Hit
 miss

Dr.Saranya.K.C
VIT
Examples: Structuring Elements (1)

origin

Dr.Saranya.K.C
VIT
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.

Dr.Saranya.K.C
VIT
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 B   z | ( B) Z  Ac  

Dr.Saranya.K.C
VIT
Example
of Erosion
(1)

Dr.Saranya.K.C
VIT
Example
of Erosion
(2)

Dr.Saranya.K.C
VIT
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  
Dr.Saranya.K.C
VIT
Examples of Dilation (1)

Dr.Saranya.K.C
VIT
Examples of Dilation (2)

Dr.Saranya.K.C
VIT
DUALITY
• Erosion and dilation are duals of each other with respect to
set complementation and reflection

 A  B µ
 Ac  B
c

and
    µ
B
c c
A B A

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
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 generates


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

Dr.Saranya.K.C
VIT
Opening and Closing

The opening of set A by structuring element B,


denoted A o B, is defined as
A oB   A  B  B

The closing of set A by structuring element B,


denoted AgB, is defined as
AgB   A  B   B

Dr.Saranya.K.C
VIT
Opening

The opening of set A by structuring element B,


denoted A o B, is defined as
A o B  U B  Z |  B  Z  A

Dr.Saranya.K.C
VIT
Example: Opening

Dr.Saranya.K.C
VIT
Example: Closing

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Duality of Opening and Closing

• Opening and closing are duals of each other with respect to


set complementation and reflection

 AgB  µ)
 ( A oB
c c

   c µ
c
A o B ( A gB )

Dr.Saranya.K.C
VIT
The Properties of Opening and Closing

• Properties of Opening
(a) A o B is a subset (subimage) of A
(b) if C is a subset of D, then C o B is a subset of D o B
(c) ( A o B) o B  A o B
• Properties of Closing

(a) A is subset (subimage) of AgB


(b) If C is a subset of D, then C gB is a subset of DgB
(c) ( AgB)gB  AgB
Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
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 

Dr.Saranya.K.C
VIT
Example 1

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Example 2

Dr.Saranya.K.C
VIT
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.

Dr.Saranya.K.C
VIT
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

Then, Xk contains all the filled holes. The set union of Xk and I contains
all the filled holes and their boundaries.

Dr.Saranya.K.C
VIT
Example

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
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 I,
which is set to 1.

Dr.Saranya.K.C
VIT
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

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Some Basic Morphological Algorithms (5)

• Thinning
The thinning of a set A by a structuring element B, defined

A  B  A  ( A * B)
 A  ( A * B) c

Dr.Saranya.K.C
VIT
Some Basic Morphological Algorithms (5)

• A more useful expression for thinning A symmetrically is


based on a sequence of structuring elements:

  
B  B1
, B 2
, B 3
,..., B n

where B i is a rotated version of B i -1

The thinning of A by a sequence of structuring element {B}


A  {B}  ((...(( A  B1 )  B 2 )...)  B n )

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Some Basic Morphological Algorithms (6)

• Thickening:

The thickening is defined by the expression


A e B  A   A* B

The thickening of A by a sequence of structuring element {B}


A e {B}  ((...(( A e B1 ) e B 2 )...) e B n )

In practice, the usual procedure is to thin the background of the set


and then complement the result.

Dr.Saranya.K.C
VIT
Some Basic Morphological Algorithms (6)

Dr.Saranya.K.C
VIT
Filling Holes

Let I ( x, y ) denote a binary image and suppose that we


form a marker image F that is 0 everywhere, except at
the image border, where it is set to 1- I ; that is

1  I ( x, y ) if ( x, y ) is on the border of I
F ( x, y )  
 0 otherwise
then
c
H   R ( F ) 
D
Ic

Dr.Saranya.K.C
VIT
SE : 3  3 1s.

Dr.Saranya.K.C
VIT
c
H   R ( F ) 
D
Ic

Dr.Saranya.K.C
VIT
Border Clearing
It can be used to screen images so that only complete objects
remain for further processing; it can be used as a singal that
partial objects are present in the field of view.

The original image is used as the mask and the following


marker image:
 I ( x, y ) if ( x, y ) is on the border of I
F ( x, y )  
 0 otherwise
X  I  RID ( F )

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Summary (1)

Dr.Saranya.K.C
VIT
Summary (2)

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Gray-Scale Morphology
f ( x, y ) : gray-scale image
b( x, y ): structuring element

Dr.Saranya.K.C
VIT
Gray-Scale Morphology: Erosion and Dilation by
Flat Structuring

 f  b ( x, y)  (min
s ,t )b
 f ( x  s, y  t )

 f  b ( x, y)  max
( s ,t )b
 f ( x  s, y  t )

Dr.Saranya.K.C
VIT
Dr.Saranya.K.C
VIT
Gray-Scale Morphology: Erosion and Dilation by
Nonflat Structuring

 f  bN  ( x, y)  (min
s ,t )b
 f ( x  s, y  t )  bN ( s, t )

 f  bN  ( x, y)  max
( s ,t )b
 f ( x  s, y  t )  bN ( s, t )

Dr.Saranya.K.C
VIT
REFERENCE
• Computer Vision: Algorithms and Applications
by Richard Szeliski Springer, 2011
• Gonzalez, Rafael C.., Woods, Richard
Eugene. Digital Image Processing. United
Kingdom: Pearson, 2018.

Dr.Saranya.K.C
VIT
• Refer class notes

Dr.Saranya.K.C
VIT

You might also like