0% found this document useful (0 votes)
35 views

Chapter 7

This document discusses morphological image processing techniques. It defines morphology and mathematical morphology. It then explains basic morphological operations like dilation and erosion through examples and properties. Dilation is used to join disconnected regions and repair breaks, while erosion is used to remove noises and split connected regions.

Uploaded by

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

Chapter 7

This document discusses morphological image processing techniques. It defines morphology and mathematical morphology. It then explains basic morphological operations like dilation and erosion through examples and properties. Dilation is used to join disconnected regions and repair breaks, while erosion is used to remove noises and split connected regions.

Uploaded by

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

Morphological Image

Processing

Image after segmentation Image after segmentation


and morphological
processing
What Is Morphology?
 Morphology
▪ The branch of biology that deals with the form
and structure of organisms without
consideration of function
 Mathematical Morphology
▪ Mathematical tool for processing shapes in
image, including boundaries, skeletons,
convex hulls, etc.
▪ Morphological operations are typically applied
to remove imperfections introduced during
segmentation, and so typically operate on
binary images
Quick Example

Image after segmentation Image after segmentation


and morphological
processing
Set Theory: Definitions and
Notations
 SET ()  Complement set
◦ A collection of objects ◦ If A  , then its complement
(elements) set Ac = {|   , and A}
 Membership ()  Union ()
◦ If  is an element (member) of ◦ A B = {|  A or  B}
a set , we can write     Intersection ()
 Subset () ◦ A  B = {|  A and  B}
◦ Let A, B are two sets. If for  Set difference (-)
every a  A, we also have a 
◦ B\A = B Ac
B, then the set A is a subset of
B, that is, A  B ◦ Note that B-A A-B
◦ If A  B and B  A, then A = B.  Disjoint sets
 Empty set () ◦ A and B are disjoint (mutually
exclusive) if A  B= 
Set Relations
Reflection and Translation
Reflection
The reflection of a set B, denoted Bˆ , is defined as
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}
Example: Reflection and
Translation
Binary image
Binary image
bi-valued function of x and y
Morphological theory views
◦ binary image as a set of its foreground (1-
valued) pixels
◦ elements of Z2 1
1 1
1 1
1 1
Logic Operations Between Binary
Images
Basic Components in
Morphology
Every Operation has two elements.
1. Input Image
2. Structuring element
The results of the operation mainly depends upon
the structuring element chosen.
Origin is not a
member of the
structuring element

Typical Structuring elements


X denotes the origin of the structuring element
Structuring element
Structuring elements can be any size and any shape

origin
Fundamental Operations
 Fundamentally morphological image
processing is very like spatial filtering
 The structuring element is moved across every
pixel in the original image to give a pixel in a
new processed image
 The value of this new pixel depends on the
operation performed
 There are two basic morphological operations:
dilation and erosion.
Dilation
 Dilation is an operation that grows or thickens
objects in a binary image.
 The specific manner of this thickening is
controlled by a shape referred to as a
structuring element.
 The structuring element is translated
throughout the domain of the image to see
where it overlaps with 1-valued pixels. The
output image is 1 at each location of the origin
s.t. the structuring element overlaps at least
one 1-valued pixel in the input image.
Dilation …
With A and B as sets in Z 2 , the dilation of A by B,
denoted A  B, is defined as

  
ˆ
A  B= z | B
z

 A  

Theoretical way of generation:


 Obtain the reflection of B about its origin
 Shift this reflection by z
 Dilation of A by B is the set of all structuring
element origin locations where the reflected and
translated B overlaps at least some portion of A.
Dilation Example
Original Image Processed Image

Structuring Element
Dilation Example
Original Image Processed Image With Dilated Pixels

Structuring Element
Dilation: Example

Dilation process
Dilation: Example …

Result after the Dilation


Dilation: Example …

Result of Dilating Object A with structuring element B (full


shape)
Dilation By A Circular Structuring
Element

The dilation of A by the structuring element B,


  
written A  B, is given by A  B  z| Bˆ  A   .
z

A A B

Examples of Dilation
(1)
Dilation: By A Rectangular Structuring
Element

The dilation of A by the structuring element B,


  
written A  B, is given by A  B  z| Bˆ  A   .
z

A A B

Examples of Dilation
(2)
Dilation: By A Structuring Element
Whose Reflection Is Not Itself

The dilation of A by the structuring element B,


  
written A  B, is given by A  B  z| Bˆ  A   .
z

B̂ A A B

Examples of Dilation
(3)
Examples of Dilation
Examples of Dilation

Original image Dilation by 3*3 Dilation by 5*5


square structuring square structuring
element element

Watch out: In these examples a 1 refers to a black pixel!


What Is Dilation For?
Dilation can repair breaks

Dilation can repair intrusions

Watch out: Dilation enlarges objects


Dilation - Bridging gaps
Original image After dilation
Dilation - Bridging gaps

Moving object
detection using
background
subtraction in
complex wavelet
domain a) current
frame b) computed
reference frame c)
background
subtraction without
morphological
processing d) results
after morphological
processing
Dilation: Another Definition
Dilation combines two sets using vector
addition
(a, b) + (c, d) = (a+c, b+d)

Let, A = {(1,0), (1,1), (1,2), (2,2), (0,3), (0,4)}


B = {(0,0), (1,0)}

Image B
Structuring
Image A
Properties of Dilation

Dilation is commutative

Dilation is associative

Dilation is invariant to translation


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  

In other words, erosion of A by B is the set of all


structuring element origin locations where the
translated B has no overlap with the background of A

Erosion “shrinks” or “thins” objects in a binary image


Erosion Example
Original Image Processed Image With Eroded Pixels

Structuring Element
Erosion Example
Original Image Processed Image

Structuring Element
Erosion: Example

Erosion process
Erosion: Example …

Result after the Erosion


Erosion: Example …

Result of Eroding Object A with structuring element B (full


shape)
Erosion: By A Circular Structuring
Element

The erosion of A by B, written AB, is given by


AB  z|B z  A.

A
AB
Example of Erosion
(1)
Erosion: By A Rectangular Structuring
Element

The erosion of A by B, written AB, is given by


AB  z|B z  A.

A
AB
Example of Erosion
(2)
Erosion: By A Structuring Element
Whose Reflection Is Not Itself

The erosion of A by B, written AB, is given by


AB  z|B z  A.

B̂ A
A B

Example of Erosion (3)


Example of
Erosion (4)
Erosion Example

Watch out: In these examples a 1 refers to a black pixel!


Erosion Example …
Erosion Example …

After
Original
erosion with
image
a disc of
radius 10

After After
erosion with erosion with
a disc of a disc of
radius 5 radius 20
What Is Erosion For?
Erosion can split apart joined objects

Erosion can split apart

Erosion can strip away extrusions

Watch out: Erosion shrinks objects


Erosion …
 The another definition is

Let, A = {(1,0), (1,1), (1,2), (0,3), (1,3), (2,3), (3,3),


(1,4)}
B = {(0,0), (1,0)}

Image B
Image A Structuring
element
Problems

1 1 1 1
1
B
1 1 1
1
1 1
1
A B
Dilation & Erosion are duals of each other
wrt set complementation & reflection

Proof:

If (B)z is contained in set A, then


But the complement of the set of z’s that satisfy

is the set of z’s that satisfy

Thus,

Remember???
Combining Dilation and
Erosion
Dilation & Erosion are not
inverse transformations

If an image is eroded & then dilated (or vice-


versa), the original image is not re-obtained
Combining Dilation and
Erosion …
▪ In practical applications, dilation and erosion
are used most often in various combinations.
▪ Three of the most common combinations of
dilation and erosion are
➢ Opening
➢ Closing
➢ Hit-or-miss transformation
Combining Dilation and
Erosion
Opening
Opening is erosion followed by dilation
The opening of set A by structuring element B,
denoted A o B, is defined as

Opening
Generally smoothes the contours of an object
Breaks narrow isthmuses
Eliminates thin protrusions
It is less destructive than the Erosion
Opening Example …

Original
Image

Image
After
Opening
Opening Example
Original Image Processed Image

Structuring Element
Opening Example
Original Image Processed Image

Structuring Element
Opening Example …

Object A and structuring element B for Opening


Opening Example …

Result when Object A is first eroded. Red coloured squares will be


turned off.
Opening Example …

Result when eroded Object A is dilated. Red coloured squares will be


turned on.
Closing
 Closing is dilation followed by erosion
The morphological closing of A by structuring element B
is given as

Closing
Also tends to smooth sections of the contours
Generally fuses narrow breaks & long thin gulfs
Eliminates small holes & fills gaps in the contour
Closing Example

Original
Image

Image
After
Closing
Closing Example
Original Image Processed Image

Structuring Element
Closing Example
Original Image Processed Image

Structuring Element
Closing Example …

Object A and structuring element B for Closing


Closing Example …

Result when Object A is first dilated. Red coloured squares will be


turned on.
Closing Example …
Morphological Processing
Example
Any Questions ?

You might also like