Professional Documents
Culture Documents
Dip 13 50
Dip 13 50
Dip 13 50
(in Biology)
2
Mathematical
Morphology
3
Mathematical morphology is increasingly
becoming a popular tool for image
processing & analysis.
4
Z : set of integers
Z2 : coordinate space (x,y)
A : a set in Z2
w = (x, y) is an element of A
w Є A
B = {w | condition }
◦ B is a set of pixel coordinates satisfying condition
AC : complement of A
5
a = (a1, a2)
Complement of set A (a is a point)
AC = { w | w A}
Reflection of set B
6
7
Binary Images
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
8
Set operations can be applied directly to
binary image sets.
For example if A and B are binary
images then
C = AUB is also a binary image.
In terms of function C is given by
1 if either A( x,y ) or B( x,y ) is 1, or both are 1
C ( x, y )
0 otherwise
C ( x, y ) | ( x, y ) A or ( x, y ) B or ( x, y ) ( A and B )
9
Logic operations
Involving
Binary Images
Note: Here
Black represents
binary 1s
White represents
binary 0s
10
The sets of black & white pixels constitute a
description of a binary image.
Assumption: only black pixels are considered &
the others are treated as background.
14
Let,
A = {(1,0), (1,1), (1,2), (2,2), (0,3), (0,4)}
B = {(0,0), (1,0)}
Image B
Image A Structuring Dilation 15
element
Dilation
(Another way of defining it)
20
Dilation when the representative point is not a
member of the structuring element
Image B
Image A Structuring Dilation
element
21
Properties of Dilation
Dilation is commutative
Dilation is associative
22
Application of Dilation
Used for bridging
gaps
B = [0 1 0; 1 1 1; 0 1 0];
23
Shrinks or thins objects in a binary
image
Controlled by structuring element
Translate structuring element, check
if it entirely fits within foreground of
image
24
Let,
A = {(1,0), (1,1), (1,2), (0,3), (1,3), (2,3), (3,3), (1,4)}
B = {(0,0), (1,0)}
Image A Image B
Structuring
element Erosion 25
Dilation & Erosion are duals of each
other wrt set complementation &
reflection
Proof:
26
But the complement of the set of z’s that satisfy
Thus,
Remember???
27
Application of Erosion
Used for eliminating
irrelevant details
It might decompose complicated
objects into several simpler ones.
28
29
30
31
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
32
If an image is eroded & then dilated (or vice-
versa), the original image is not re-obtained
33
Opening
Erosion followed by dilation
The morphological opening of A by structuring
element B is given as
Opening
Generally smoothes the contours of an object
Breaks narrow isthmuses
Eliminates thin protrusions
It is less destructive than the Erosion
34
erode then dilate
union of all translations of B that fit
entirely within A
not union of the "origins" which would
be erosion
removes small objects and restores
shape
35
Closing
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
36
If an image A is unchanged by opening with the
structuring element B, then it is called
open with respect to B
If an image A is unchanged by closing with the
structuring element B, then it is called
closed with respect to B
37
Geometric interpretation of Opening operation
39
40
41
Properties of
Opening Operation
is a subset (subimage) of A
42
Properties of
Closing Operation
A is a subset (subimage) of
43
The Hit-or-Miss
Transformation
45
Erosion of A by X is the set of locations of
origin of X, such that X is completely
contained in A.
Therefore,
may be viewed geometrically as the set of all
locations of origin of X at which X found a
match (hit) in A.
46
This notion can be generalized by letting
B = (B1, B2) where
47
The set
Contains all the (origin) points at which,
simultaneously, B1 found a match (hit) in A
and B2 found a match in Ac.
Note: A - B = A ∩ BC
48
49
Hit: matches all 1's in B1
Erode to detect pixels with
Miss: none of 1s in B2
Erode to remove pixels with
50