Morphological Image Processing
“Morphology “ – a branch in biology that deals with the form and structure of
animals and plants.
“Mathematical Morphology” – as a tool for extracting image components,
that are useful in the representation and description of region shape.
The language of mathematical morphology is – Set theory.
Unified and powerful approach to numerous image processing problems.
In binary images , the set elements are members of the 2-D integer space – Z2.
where each element (x,y) is a coordinate of a black (or white) pixel in the
image.
Basic Concepts in Set Theory
Subset 𝐴⊆𝐵
• Union 𝐴 ∪ 𝐵
Intersection 𝐴 ∩ 𝐵
• disjoint / mutually exclusive 𝐴 ∩ 𝐵 = ∅
Complement 𝐴( ≡ {𝑤|𝑤 ∉ 𝐴}
Difference 𝐴 − 𝐵 ≡ {𝑤|𝑤 ∈ 𝐴, 𝑤 ∉ 𝐵} = 𝐴 ∩ 𝐵(
Reflection 𝐵2 ≡ {𝑤|𝑤 = −𝑏, ∀𝑏 ∈ 𝐵}
Translation 𝐴(𝑧) ≡ {𝑐|𝑐 = 𝑎 + 𝑧, ∀𝑎 ∈ 𝐴}
Logic Operations Involving Binary Pixels and Images
The principal logic operations used in image processing are: AND, OR, NOT
(COMPLEMENT).
These operations are functionally complete.
Logic operations are preformed on a pixel by pixel basis between corresponding
pixels (bitwise).
Other important logic operations :
XOR (exclusive OR), NAND (NOT-AND)
Logic operations are just a private case for a binary set operations, such : AND –
Intersection , OR – Union,
NOT-Complement.
Dilation
Dilation is used for expanding an element A by using structuring
element B
Dilation of A by B and is defined by the following equation:
𝐴 ⊕ 𝐵 ≡ {𝑧|(𝐵)= > ∩ 𝐴 ≠ ∅}
Dilation is obtained by obtaining the reflection of B ( structuring element) about its
origin and shifting this reflection by z
This equation is based on obtaining 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. Based on this interpretation the equation of the above
equation can be rewritten as:
= 𝑧 ∩ 𝐴] ⊂ 𝐴D
𝐴 ⊕ 𝐵 ≡ @𝑧|[(𝐵)
Dilation in general causes objects to dilate or grow in size. The application of dilation is to
bridge gaps.
If there is a very small object say (hole) inside the object A, then this hole is filled up
Small disconnected regions outside the boundary may be connected
Irregular boundary may be smoothed out.
Properties of Dilation
𝐴⊕𝐵 =𝐵⊕𝐴 𝐶𝑜𝑚𝑚𝑢𝑡𝑎𝑡𝑖𝑣𝑒
𝐴 ⊕ (𝐵 ⊕ 𝐶) = (𝐴 ⊕ 𝐵) ⊕ 𝐶) 𝐴𝑠𝑠𝑜𝑐𝑖𝑎𝑡𝑖𝑣𝑒
(𝐴 ⊕ 𝐵)N = 𝐴N ⊕ 𝐵 𝑇𝑟𝑎𝑠𝑙𝑎𝑡𝑖𝑜𝑛 𝐼𝑛𝑣𝑎𝑟𝑖𝑎𝑛𝑡
Erosion
• Erosion is used for shrinking of element A by using element B
Erosion for Sets A and B in Z2, is defined by the following equation:
𝐴 ⊝ 𝐵 ≡ {𝑧|(𝐵)> ⊆ 𝐴}
This equation indicates that the erosion of A by B is the set of all points z such that B,
translated by z, is comtained in A. Structuring element B should be completely inside
A.
Erosion contracts the image.
Duality between dilation and erosion
Dilation and erosion are duals of each other with respect to set complementation and
reflection. That is,
(𝐴 ⊝ 𝐵)( ≡ 𝐴U ⊕ 𝐵2
One of the simplest uses of erosion is for eliminating irrelevant details (in terms of
size) from a binary image.
Opening And Closing
Opening – smoothes contours , eliminates protrusions
Closing – smoothes sections of contours, fuses narrow breaks and long thin gulfs,
eliminates small holes and fills gaps in contours
These operations are dual to each other
These operations are can be applied few times, but has effect only once
Opening –
First – erode A by B, and then dilate the result by B
In other words, opening is the unification of all B objects Entirely Contained
in A
𝐴𝜊𝐵 ≡ {(𝐴 ⊖ 𝐵) ⊕ 𝐵}
• Closing –
• First – dilate A by B, and then erode the result by B
• In other words, closing is the group of points, which the intersection of object
B around them with object A – is not empty
𝐴 ∙ 𝐵 ≡ {(𝐴 ⊕ 𝐵) ⊖ 𝐵 }
Dilation by 3x3 structuring element
Erosion by 3x3 structuring element