0% found this document useful (0 votes)
149 views54 pages

Morphological Image Processing

Binary images may contain numerous imperfections. In particular, the binary regions produced by simple thresholding are distorted by noise and texture. Morphological image processing pursues the goals of removing these imperfections by accounting for the form and structure of the image. These techniques can be extended to greyscale images.

Uploaded by

Nauman Amjad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
149 views54 pages

Morphological Image Processing

Binary images may contain numerous imperfections. In particular, the binary regions produced by simple thresholding are distorted by noise and texture. Morphological image processing pursues the goals of removing these imperfections by accounting for the form and structure of the image. These techniques can be extended to greyscale images.

Uploaded by

Nauman Amjad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 54

CS589-04 Digital Image Processing

Lecture 5. Morphological Image


Processing
Fall 2015
Bahria University

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

03/31/16

Preliminaries (1)

Reflection

, is defined as
The reflection of a set B, denoted B
{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}
03/31/16

Example: Reflection and Translation

03/31/16

Preliminaries (2)

Structure elements (SE)


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

03/31/16

Examples: Structuring Elements (1)

origin

03/31/16

Examples: Structuring Elements (2)


Accommodate the
entire structuring
elements when
its origin is on the
border of the
original set A

Origin of B visits
every element of 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.

03/31/16

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

B,

B z | ( B) Z A

The set of all points z such that B, translated by z , is contained by A.

03/31/16

B z | ( B ) Z A
c

Exampl
e of
Erosion
(1)

03/31/16

Exampl
e of
Erosion
(2)

03/31/16

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 A
A B z | B

z
03/31/16

11

Examples of Dilation (1)

03/31/16

12

Examples of Dilation (2)

03/31/16

13

Duality

Erosion and dilation are duals of each other with


respect to set complementation and reflection

A B

A B
c

and

A B

03/31/16

Ac B

14

Duality

Erosion and dilation are duals of each other with


respect to set complementation and reflection

A B

z | B Z A

z | B Z A
c

z | B Z Ac

Ac B
03/31/16

15

Duality

Erosion and dilation are duals of each other with


respect to set complementation and reflection

A B

A
A
z | B

z| B

Ac B
03/31/16

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


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

03/31/16

17

Opening and Closing


The opening of set A by structuring element B,
denoted A oB, 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
03/31/16

18

Opening
The opening of set A by structuring element B,
denoted A oB, is defined as

A oB U B Z | B Z A

03/31/16

19

Example: Opening

03/31/16

20

Example: Closing

03/31/16

21

03/31/16

22

Duality of Opening and Closing

Opening and closing are duals of each other with


respect to set complementation and reflection

AgB

A oB

03/31/16

)
( A oB
c

)
( A gB
c

23

The Properties of Opening and Closing

Properties of Opening

(a) A oB is a subset (subimage) of A


(b) if C is a subset of D, then C oB is a subset of D oB
(c) ( A oB) oB A oB

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 D gB
(c) ( AgB )gB AgB
03/31/16

24

03/31/16

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 )
03/31/16

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

03/31/16

27

Example 1

03/31/16

28

Example 2

03/31/16

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.

03/31/16

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

03/31/16

31

Example

03/31/16

32

03/31/16

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.

03/31/16

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

03/31/16

35

03/31/16

36

03/31/16

37

Gray-Scale Morphology
f ( x, y ) : gray-scale image
b( x, y ): structuring element

03/31/16

38

Gray-Scale Morphology: Erosion and


Dilation by Flat Structuring

f ( x s, y t )

f b ( x, y ) (min
s ,t )b
f ( x s, y t )

f b ( x, y) max
( s ,t )b

03/31/16

39

03/31/16

40

Gray-Scale Morphology: Erosion and


Dilation by Nonflat Structuring

f ( x s, y t ) bN ( s, t )

f bN ( x, y ) (min
s ,t )b
f ( x s, y t ) bN ( s, t )

f bN ( x, y ) max
( s ,t )b

03/31/16

41

03/31/16

42

03/31/16

43

Morphological Smoothing

Opening suppresses bright details smaller than the


specified SE, and closing suppresses dark details.

Opening and closing are used often in combination


as morphological filters for image smoothing and
noise removal.

03/31/16

44

Morphological Smoothing

03/31/16

45

Morphological Gradient

Dilation and erosion can be used in combination


with image subtraction to obtain the morphological
gradient of an image, denoted by g,

g ( f b) ( f b)

The edges are enhanced and the contribution of the


homogeneous areas are suppressed, thus producing
a derivative-like (gradient) effect.

03/31/16

46

Morphological Gradient

03/31/16

47

Top-hat and Bottom-hat Transformations

The top-hat transformation of a grayscale image f is


defined as f minus its opening:

That ( f ) f ( f ob)

The bottom-hat transformation of a grayscale


image f is defined as its closing minus f:

Bhat ( f ) ( f b) f
03/31/16

48

Top-hat and Bottom-hat Transformations

One of the principal applications of these


transformations is in removing objects from an
image by using structuring element in the opening
or closing operation

03/31/16

49

Example of Using Top-hat Transformation in


Segmentation

03/31/16

50

Granulometry

Granulometry deals with determining the size of


distribution of particles in an image

Opening operations of a particular size should have


the most effect on regions of the input image that
contain particles of similar size

For each opening, the sum (surface area) of the


pixel values in the opening is computed

03/31/16

51

Example

03/31/16

52

Textual Segmentation

Segmentation: the process of subdividing an image


into regions.

03/31/16

53

Textual Segmentation

03/31/16

54

You might also like