0% found this document useful (0 votes)
38 views45 pages

Morphological Image Processing New

ab

Uploaded by

manat s
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)
38 views45 pages

Morphological Image Processing New

ab

Uploaded by

manat s
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/ 45

EEE F435 (2021-22-I)

Digital Image Processing


(Morphological Image Processing)
BITS Pilani Ashish Chittora
K K Birla Goa Campus
Mathematical Morphology
• Mathematical morphology is a powerful tool that can
be used to extract features and components from an
image
• In morphology, a small shape (structuring element) is
translated across the image during the course of
processing
• Important techniques
• Dilation
• Erosion
• Opening
• Closing
• Region filling
• Boundary extraction
Binary images
• Representation of individual pixels as 0 or 1,
convention:
– foreground, object = 1 (white)
– background = 0 (black)
• Binary images commonly used in
– Text and document image processing
– As intermediate images, Masks for segmentation
Basic Set theory
Logic operations with binary images

Here black=1
and white=0
for better
representation
Reflection
• Reflection
𝐵 = {𝑤|𝑤 = −𝑏, 𝑓𝑜𝑟 𝑏 ∈ 𝐵}
Translation
• If A=binary image and w=(x,y) is a particular
coordinate point then
Aw = {(a,b)+(x,y) : (a,b) ϵ A }
= Set A translated in direction (x,y)
• If w=(2,2) ,the set A has been shifted in the x
and y directions by the values given in w.
Structuring elements (SE)
• SE is a small image ,used as a moving window, whose
support delineates pixel neighborhoods in the image
plane
• SE controls and decides the final shape of object in result
image
• SE can be of any shape, size or connectivity
• SE’s origin can be placed anywhere relative to its support
• SE’s origin is generally its centre of gravity, but can be
other point also
• In DIP, SE are rect. arrays, so smallest possible background
elements (0 pixels) are added.
• SE visits each pixel on image with its origin and perform
specified Set / Logical operation
Structuring elements
Structuring elements
Dilation
• Dilation (thickening) is an operation that grows objects in a binary
image (thickening controlled by structuring element)
• If A= binary image and B=structuring element

A  B  {z|(Bˆ )z  A  Φ}
A B  A x
xB
• What this means is that for every point, xB we translate A by
those coordinates. Then we take the union of all these translations.
• Simplified : When SE visits on a target pixel, it performs OR
operation around neighborhood including the target pixel.
Dilation
Dilation

When Structuring element


not centred at origin
Dilation

Structuring element

Binary image
Dilation
Dilation

Binary image Dilated binary image

Structuring element
Dilation

Original image Dilated image


Dilation

Binary image Dilated binary image


Erosion
• Erosion is the thinning operation of binary image
with the help of structuring element
• Erosion of a binary image A by SE B is defined by
A  B  {z|(B)z  A}
• In other words erosion of A by B consists of all
points w= (x,y) for which Bw is in A
• Simplified: When SE visits on a target pixel, if SE 1
valued pixel overlaps with background pixel/pixels,
then the target pixel will change to Zero. Only those
pixels will retain in final image for which the SE is
completely within the foreground region.
Erosion
Erosion

Structuring element

Binary image
Erosion
Erosion

Binary image Eroded binary image

Structuring element
Erosion

Original image Eroded image


Erosion
Eliminating irrelevant details

Erosion Dilation
SE=13x13 SE=13x13
Erosion

Image with Erosion by disk shape Erosion by disk shape


overlapped blobs SE (dia. 15) SE (dia. 48)
Erosion
Duality
• Dilation and Erosion are duals of each other

• Vice versa is also true


Opening
• Erosion followed by dilation
• Opening smoothes object contours, breaks
thin connections and removes thin
protrusions
• After opening, all objects smaller than the
structuring element will disappear
• Outward pointing corners become rounded,
inward pointing corners become unchanged
(only when SE is circular shape)
Opening
Closing
• Dilation followed by Erosion
• Eliminates small holes
• Fills gap in contour
• Fuses narrow breaks and long thin gulfs
• Outward pointing corners unchanged, inward
pointing corners become rounded (only when
SE is circular shape)
Closing
Example

Dilation of eroded image (opening) Erosion of dilated image (closing)


Properties
• Opening and Closing are duals of each other

Vice versa is also true


• is subset of A. (Also true for opening)
• = ,same is true for opening
Boundary Extraction
• External boundary: (A B)-A
• Internal boundary: A-(A B)
• Morphological gradient: (A B)-(A B)
Boundary Extraction

Structuring
Element

Eroded image Boundary extracted image


Boundary Extraction
Region filling

A AC

X k  ( X k 1  B)  Ac k  1,2,3,...
Hole/Region-Filling
• Given A and B
• Start with X0 (zero matrix of same
Size as A) with a known point in hole.

X 1  ( X 0  B )  Ac
• Repeat the above step until
Xk = X k-1
• Xk contains filled region of hole.
• Xk U A = hole filled image

• Any number of holes in image can


Be filled, if a point in each hole is known
Region filling

•Holes may be created due to reflections in original image of metal ball bearings.
More techniques
• Hit or Miss Transform : to find a shape in image
• Skeletonization: Minimum number of connected
1-valued pixels symmetrically contained within
the shape
Exercise
• For the given binary image A and structuring element
B:
– Compute the morphological opening of A with B.
– Demonstrate using example that dilation and erosion are
duals of each other.
Solution
• Opening= Erosion followed by dilation
Thank you

You might also like