Lect 8

You might also like

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

Dr.Azmi T.

Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

Morphology in image processing

Image processing is a method to convert an image into digital form by


performing operations on it for getting an enhanced image or to extract
some useful information from it.
Mathematical Morphology is one of the important term is a branch of
image processing which is particularly useful for analyzing shapes in
images.
It is a theory and technique or is a theoretical framework based on sets
theory for the analysis and processing of geometrical structures.
The size and shape of objects play an important role in morphology
theory.
There are many applications of mathematical morphology in image
processing such as:
Preprocessing (Noise detection and filtering, shape simplification,)
Enhancing object structure
Image restoration
Image segmentation,
Corner detection,
Component analysis and text extraction from image,
Quantitative description (Area, perimeter, …).

These applications are fulfilled with the help of mathematical


operators.

1
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

The Fundamental Operators in Morphology:


1- Dilation: (Expansion) is used to increase the area of a component.
It adds pixels or "grow" or "thicken" around the boundaries and fills
interior holes in binary image.
The number of pixels added depends on the size and shape of structuring
element.
Mathematically, the dilation of a set A by B denoted A  B is define as
A  B =⋃𝑥∈𝐵 𝐴𝑥
This means is that for every point 𝑥 ∈ 𝐵 , we translate A by those
coordinates .Then we take the union of all these translations
A  B ={(𝑥, 𝑦} + (𝑢, 𝑣): (𝑥, 𝑦) ∈ 𝐴, (𝑢, 𝑣) ∈ 𝐵}
A  B =B  A
Example:
Original Image (A) Structure element (B)

2
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

Applied the structure element on original image

Image after dilation

pixels are added Original Pixels

We note in above figure the dilation has the effect of increasing the size
of an object.

3
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

2- Erosion: (Contraction); Reducing the number of pixels from the object


boundary or shrinks or thins object in a binary image.
The number of pixels are removed depends on the size of structuring
elements.
Mathematically, the erosion of a set A by B denoted A Ɵ B is define as
A Ɵ B ={𝑤: 𝐵𝑤 ⋸ 𝐴}
the erosion of A by B consists of all points w=(x,y) which Bw is in Original
Image.

Original image (A) Structuring element(B)

image after erosion pixels are removed original pixels

4
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

Example:
Original image A Structuring elements B

0 0 0 0 0 0
0 0 1 1 0 0 1
0 1 1 1 1 0 1
1
0 0 1 1 0 0
0 0 0 0 0 0
Compute:
a) A dilated B
b) Ac eroded by B
a) Full match B with A:1 (1,1=1),
Some match:1(1,0=1),
No match: 0 (0,0=0)
Image after dilation Added pixel original pixel

0 0 1 1 0 0 1 1 0

0 1 1 1 1 0
0 1 1 1 1 0
0 1 1 1 1 0
0 0 1 1 0 0
5
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

b) Ac Eroded B
Full match B with A:1; (1,1=1),
some match:0; (1,0=0),
no match: 0; (0,0)=0
Original image (A) Structuring elements (B)

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

Ac
1 1 1 1 1 1
1 1 0 0 1 1 1
1
1 0 0 0 0 1
1
1 1 0 0 1 1
1 1 1 1 1 1

6
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

Image after erosion Removed pixel Original pixel

0 0 0 0 0 0 0 1 0

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

Common structuring elements:


 Binary filters are often called structuring elements.
 The most common structuring elements are illustrated below.
 The origin is marked with a point.

●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮
●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮
●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮 ●󠄮
H.V V.V N4 ND N8

Where H.V is horizontal vector, V.V is vertical vectors, N4 is


4-neighbors of center pixel, ND is 4-diagonal neighbors of center pixel,
and N8 is 8-neighbors of center pixel.
7
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

3- Opening:
Is representing by (A o B)
Opening= Erosion + Dilation
A o B= (A Ɵ B)  B
A  B is a subset of A
A  B   B  A  B

4-Closing:
Is representing by A  B
Closing = Dilation + Erosion
A  B  A  B  Ɵ B
A is a subset of A  B
A  B  B  A  B
5- Hit-or-Miss Transform: Is actually aimed to detected an objected of
a specific shape and size in a given image.

8
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

Applications:

9
Dr.Azmi T.Al-Rawi
University of Anbar\ College Of Computer Science& I.T
Graduate studying (Master)
Lec.8

References:
[1] (PDF) Role of Mathematical Morphology in Digital Image Processing:
A Review. Available from:
https://www.researchgate.net/publication/303760248_Role_of_Mathema
tical_Morphology_in_Digital_Image_Processing_A_Review [accessed
Apr 30 2020].
[2] Maria Magnusson, Computer Vision Lab., Dept. of Electrical
Engineering, Linköping University.

10

You might also like