Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 20

Digital Image Processing

Lecture # 12
Morphological Operations

1
Morphological Algorithms
Using the simple technique we have looked at so far we
can begin to consider some more interesting morphological
algorithms
We will look at:
 Boundary extraction

 Region filling

 Extraction of connected components

There are lots of others as well though:


 Thinning/thickening

 Skeletonization

2
Boundary Extraction

The
Theboundary
boundaryofof set
set AAdenoted
denotedbyby β(A)
β(A) isisobtained
obtainedbyby
first
first eroding
eroding AAby
byaasuitable
suitablestructuring
structuringelement
element BBandand
then
thentaking
takingthe
thedifference
differencebetween
between AAand
anditsitserosion.
erosion.

 ( A)  A  ( A ! B)

3
Boundary Extraction
((AA))  AA((AA!! BB))

4
Boundary Extraction
A simple image and the result of performing boundary
extraction using a square 3*3 structuring element

Original Image Extracted Boundary

5
Region (hole) Filling
Given a pixel inside a boundary, region filling attempts to fill
that boundary with object pixels (1s)

Given
Givenaapoint
pointinside
insidehere,
here,can
canwe
we
fill
fillthe
thewhole
wholecircle?
circle?

6
Region Filling
Let A is a set containing a subset whose elements are 8-connected
boundary points of a region, enclosing a background region i.e. hole

If all boundary points are labeled 1 and non boundary points are
labeled 0, the following procedure fills the region:
Inside the boundary

 Start from a known point p and taking X0= p,


 Then taking the next values of Xk as:
X k  ( X k  B )  Ac k  1, 2,3,
B is suitable structuring element
 Terminate iterations if Xk+1 = Xk
 The set union of Xk and A contains the filled set and its boundaries.

7
Region Filling
0 0 0 0 0 0 0 1 1 1 1 1 1 1
0 1 1 1 1 1 0 1 0 0 0 0 0 1
0 1 0 0 0 1 0 1 0 1 1 1 0 1 0 1 0

0 1 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1
0 1 0
0 1 0 0 0 1 0 1 0 1 1 1 0 1
0 1 1 1 1 1 0 1 0 0 0 0 0 1
B
0 0 0 0 0 0 0 1 1 1 1 1 1 1

A Ac
Region Filling

0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 1 0 0 1 1 1 0 0 0
0 0 0 0 0 0 0 1 1 1 0 0 1 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 0 0 0 B 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0

( X 0  B)
X0
X k 1  ( X k  B )  Ac
k  1, 2,3,
Region Filling

0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0

0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0

0 1 1 1 0 0 0 1 0 1 1 1 0 1 0 0 1 1 0 0 0

0 0 1 0 0 0 0 1 0 1 1 1 0 1 0 0 1 0 0 0 0
0 0 0 0 0 0 0 1 0 1 1 1 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0
X 1  ( X 0  B)
Ac X 1  ( X 0  B )  Ac

X k 1  ( X k  B )  Ac
k  1, 2,3,
Region Filling

X k 1  ( X k  B )  Ac
k  1, 2,3,

NOTE:
The intersection of dilation
and the complement of A
limits the result to inside
the region of interest

11
Region Filling: Example

Original Image One Region All Regions


Filled Filled

12
Gray Level Image Morphological
Operations
Dilation & Erosion
Opening & Closing
Morphological Gradient
Top Hat & Bottom Hat
Transformations
Readings from Book (3 Edn.)
rd

• Morphological Operations
(Chapter – 9)
• Reading Assignment
• Connected Component
Acknowledgements
 Digital Image Processing”, Rafael C. Gonzalez & Richard E. Woods, Addison-Wesley, 2002
 Computer Vision for Computer Graphics, Mark Borg
Material in these slides has been taken from, the following resources

21

You might also like