ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
MORPHOLOGICAL OPERATIONS 
Dilation AND Erosion 
Brainbitz
Morphological operation 
• It is a collection of non-linear operations 
related to the shape or morphology of 
features in an image. 
• ie , we process images according to its shape 
• 2 fundamental operations 
Dilation 
Erosion 
Brainbitz
DILATION AND EROSION 
• Dilation adds pixels to the boundaries of 
objects in an image 
• Erosion removes pixels on object boundaries 
Brainbitz
DILATION 
• It grows or thicken objects in a binary image 
• Thickening is controlled by a shape referred to 
as structuring element 
• Structuring element is a matrix of 1’s and 0’s 
Brainbitz
Brainbitz
Brainbitz
Opening and Closing operations 
• Opening  An Erosion followed by a dilation 
• Closing  A dilation followed by an erosion 
Brainbitz
Brainbitz
Brainbitz
Structuring element 
• The number of pixels added or removed from 
the objects in an image depends on the size 
and shape of the structuring element 
• It’s a matrix of 1’s and 0’s 
• The center pixel of the structuring element, 
called the origin 
Brainbitz
Origin of a Diamond-Shaped Structuring 
Element 
Brainbitz
Dilation and erosion operation 
• It use hit or miss transformation 
• In the hit and miss transformation, an object 
represented by a set X is examined through a 
structural element represented by a set B. 
• The structuring element is a shaped matrix 
Brainbitz
Cont. 
• Miss  No changes 
• Hit  at least one pixel matches =>The 
origin is replaced by 1 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 0 1 1 1 0 
0 0 1 1 1 0 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 1 1 1 1 1 
0 1 1 1 1 1 
0 0 0 0 0 0 
0 0 0 0 0 0 
1 1 1 
Input matrix Structuring 
element Dilated matrix 
Brainbitz
Dilation in MATLAB 
• Syntax 
Y = imdilate(A,B) 
• A  input image 
• B  Structuring element 
• Y Dilated image 
Brainbitz
Structuring element in MATLAB 
• They can be easily created using ‘strel’ 
function 
se = strel ( shape , parameters ) 
• Shape can be ‘ diamond ’ , ’ square ’ , ’ disk ’ , 
’ line ’ etc. 
Brainbitz
Erosion in MATLAB 
• It shrinks or thin objects in a binary image 
• Syntax se =imerode(A,B) 
• Output is 1 when element completely fits 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 0 1 1 1 0 
0 0 1 1 1 0 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 0 0 0 0 0 
0 0 0 1 0 0 
0 0 0 1 0 0 
0 0 0 0 0 0 
0 0 0 0 0 0 
1 1 1 
Input matrix Structuring 
element Dilated matrix 
Brainbitz
Dilation program 
BW = zeros(9,10); 
BW(4:6,4:7) = 1 
SE = strel('square',3) 
BW2 = imdilate(BW,SE) 
Brainbitz
Brainbitz
Brainbitz
Questions 
Brainbitz 
• Perform dilation and erosion

More Related Content

Dilation and erosion

  • 1. MORPHOLOGICAL OPERATIONS Dilation AND Erosion Brainbitz
  • 2. Morphological operation • It is a collection of non-linear operations related to the shape or morphology of features in an image. • ie , we process images according to its shape • 2 fundamental operations Dilation Erosion Brainbitz
  • 3. DILATION AND EROSION • Dilation adds pixels to the boundaries of objects in an image • Erosion removes pixels on object boundaries Brainbitz
  • 4. DILATION • It grows or thicken objects in a binary image • Thickening is controlled by a shape referred to as structuring element • Structuring element is a matrix of 1’s and 0’s Brainbitz
  • 7. Opening and Closing operations • Opening  An Erosion followed by a dilation • Closing  A dilation followed by an erosion Brainbitz
  • 10. Structuring element • The number of pixels added or removed from the objects in an image depends on the size and shape of the structuring element • It’s a matrix of 1’s and 0’s • The center pixel of the structuring element, called the origin Brainbitz
  • 11. Origin of a Diamond-Shaped Structuring Element Brainbitz
  • 12. Dilation and erosion operation • It use hit or miss transformation • In the hit and miss transformation, an object represented by a set X is examined through a structural element represented by a set B. • The structuring element is a shaped matrix Brainbitz
  • 13. Cont. • Miss  No changes • Hit  at least one pixel matches =>The origin is replaced by 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 Input matrix Structuring element Dilated matrix Brainbitz
  • 14. Dilation in MATLAB • Syntax Y = imdilate(A,B) • A  input image • B  Structuring element • Y Dilated image Brainbitz
  • 15. Structuring element in MATLAB • They can be easily created using ‘strel’ function se = strel ( shape , parameters ) • Shape can be ‘ diamond ’ , ’ square ’ , ’ disk ’ , ’ line ’ etc. Brainbitz
  • 16. Erosion in MATLAB • It shrinks or thin objects in a binary image • Syntax se =imerode(A,B) • Output is 1 when element completely fits 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 Input matrix Structuring element Dilated matrix Brainbitz
  • 17. Dilation program BW = zeros(9,10); BW(4:6,4:7) = 1 SE = strel('square',3) BW2 = imdilate(BW,SE) Brainbitz
  • 20. Questions Brainbitz • Perform dilation and erosion