You are on page 1of 29

Digital Image Processing, 2nd ed. www.imageprocessingbook.

com

Chapter 9
Morphological
Image Processing

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Concepts from Set Theory

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Concepts from Set Theory

Translation
Reflection

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Logic Operations Involving Binary Images

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Logic Operations Involving Binary Images

A B

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Dilation and Erosion


Dilation

• With A and B as sets in Z2, the dilation of A by B is defined as



A  B  z | ( Bˆ ) z  A   
where B̂ : the reflection of B about its origin and shifting this
reflection by z
• The dilation of A by B is the set of all displacements, z, such
that B̂ and A overlap by at least one element. Thus,


A  B  z | [( Bˆ ) z  A]  A 
• Set B is referred to as the structuring element in dilation.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Dilation and Erosion


Dilation

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Dilation and Erosion


Dilation Example

Structuring element
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Dilation and Erosion


Erosion

• For sets A and B in Z2, the erosion of A by B is defined as


AΟB  z | ( B ) z  A
where B̂ : the reflection of B about its origin and shifting this
reflection by z
• The erosion of A by B is the set of all points z, such that B,
translated by z is contained in A.
( AOB)c  Ac  Bˆ
( AOB) c  z | ( B) z  A
c


 z | ( B) z  A   c
c

 z | ( B) z  Ac    Ac  Bˆ
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Dilation and Erosion


Erosion

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Dilation and Erosion


Erosion Example

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Opening and Closing

• Opening:
– smooth the contour of an object, break narrow isthmuses, and eliminate
thin protrusions.
– The opening A by B is the erosion of A by B, followed by a dilation of
the result by B
A  B  ( AΟB)  B
A  B  ( B) z | ( B) z  A
• Closing:
– smooth sections of contours but it generally fuses narrow breaks and
long thing gulfs, eliminates small holes, and fills gaps in the contour.

A  B  ( A  B)ΟB

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Opening and Closing


Opening

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Opening and Closing


Closing

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Opening and Closing


Opening Example

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Opening and Closing


Closing Example

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Opening and Closing

• The opening operation satisfies the following properties:


– A  B is a subset (subimage) of A.
– If C is a subset of D, then C  B is a subset of D  B .
– ( A  B)  B  A  B

• The closing operation satisfies the following properties:


– A is a subset (subimage) of A  B .
– If C is a subset of D, then C  B is a subset of D  B .
– ( A  B)  B  A  B

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Opening and Closing

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

The Hit-or-Miss Transformation



B  ( AOX )  Ac O(W  X )
A*  B  ( X ,W  X )

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

The Hit-or-Miss Transformation



B  ( AOX )  Ac O(W  X )
A*  B  ( X ,W  X )

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Boundary Extraction

• The boundary of a set A,


 ( A)  A  ( AOB)
where B is a suitable structuring element.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Boundary Extraction Example

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Region Filling

• The following procedure can fill the region:


X k  ( X k 1  B)  Ac
where X0 = p, and B is the symmetric structuring
element shown in Fig. 9.15.
• Note that p is the initial point we should assign.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Region Filling

0
1

X0=p

X k  ( X k 1  B)  Ac

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Region Filling

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Extraction of Connected Components

X k  ( X k 1  B)  A

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Extraction of Connected Components

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Thinning

• The thinning of a set A by a structuring element B can be


defined in terms of the hit-or-miss transform:
A  B  A  ( A* OB)
 A  ( A*
OB) c
• A more useful expression for thinning A symmetrically is
based on a sequence of structuring elements:
B  B1 , B 2 , B3 ,..., B n 
A  B  ((...(( A  B1 )  B 2 )...)  B n )

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Some Basic Morphological Algorithms


Thinning

© 2002 R. C. Gonzalez & R. E. Woods

You might also like