SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Morphological Operations
Dr. Chandran Saravanan, NIT
Durgapur, India
Dr.cs1973@gmail.com
Overview
• morphology is a tool for extracting image
components
• useful in the description of region shape, such as
boundaries, skeletons, and convex hulls
• mathematical morphology is set theory, it can
apply directly to binary (two-level) images
– either in the set (a pixel is set, or put to foreground)
– or it isn't (a pixel is reset, or put to background)
• the usual set operators (intersection, union,
inclusion, complement) can be applied to them
Overview continues
• Basic operations in mathematical morphology
operate on two sets:
– the first one is the image, and
– the second one is the structuring element
• The structuring element used in practice is
generally much smaller than the image, often
a 3x3 matrix
• Applied on greyscale images too
EROSION
• The basic effect of erosion operator on a
binary image is to erode away the boundaries
of foreground pixels (usually the white pixels).
• Thus areas of foreground pixels shrink in size,
and "holes" within those areas become larger.
• Mathematically, erosion of set A by set B is a
set of all points x such that B translated by x is
still contained in A.
EROSION continues
• Let foreground pixels be represented by logical
1's, and background pixels by logical 0's.
• As a practical example, take a 3x3 matrix of
logical 1's, with the middle point chosen as the
origin of the set is used as the structuring
element B (see the following picture).
• To compute the erosion of a binary input image
by this structuring element, consider each of the
foreground pixels in the input image in turn.
EROSION EXAMPLE
EROSION continues
• For each input pixel we superimpose the structuring
element on top of the input image so that the origin of
the structuring element coincides with the input pixel
coordinates.
– If the input pixel is set to foreground and all its 8
neighbours are also set to foreground, then the pixel
remains set to foreground.
– If the input pixel is set to foreground, but at least one of its
8 neighbours is not, the pixel is set to background.
– Input pixels set to background remain such.
• This operation can be performed on binary images
simply by applying a logical AND function.
DILATION
• The basic effect of dilation on binary images is
to enlarge the areas of foreground pixels
(i.e. white pixels) at their borders.
• The areas of foreground pixels thus grow in
size, while the background "holes" within
them shrink.
• Mathematically, erosion of A by B is the set of
all x displacement such that B and A overlap
by at least one non-zero element.
DILATION continues
• Again let us take a 3x3 matrix for the structuring
element, with the center pixel used as the origin
of the set. B, then the dilation can be performed
using the logical OR function:
– If the pixel is set to foreground, it remains such.
– If the pixel is set to background, but at least one of its
eight neighbours is set to foreground, the pixel is
converted to foreground.
– If the pixel is set to background and none of its eight
neighbours is set to foreground, the pixel remains set
to background.
DILATION EXAMPLE
OPENING AND CLOSING
• The opening is a composite operator,
constructed from the two basic operators
described above.
• Opening of set A by set B is achieved by first
the eroding set A by B, then dilating the
resulting set by B.
OPENING EXAMPLE
CLOSING
• The closing, like opening, is also a composite
operator.
• The closing of set A by set B is achieved by
first dilating of set A by B, then eroding the
resulting set by B.
CLOSING EXAMPLE
BOUNDARY EXTRACTION
• The boundary of set A can be found by first
eroding A by B, then taking the set difference
between the original A and the eroded A.
BOUNDARY EXTRACTION EXAMPLE
GREYSCALE IMAGES
• The ideas above can be extended to greyscale
images as well.
• In greyscale images, each pixel can have the
value in a certain range, i.e. 0 to 255, with 0
representing black and 255 representing
white.
GREYSCALE EROSION AND DILATION
• Greyscale erosion is analogous to its binary
counterpart.
• Greyscale erosion darkens small bright areas, and
very small bright areas like noise spikes or small
spurs might be totally removed.
• Working with a 3x3 structuring element as above,
greyscale erosion is implemented as follows:
– the numerical values of the point and its eight
neighbours are evaluated
– minimal value of these 9 values is found
– the new value of the point is set to the minimal value
GREYSCALE EROSION EXAMPLE
• On the left side there is the original image, on
the right side is the eroded image.
GREYSCALE DILATION
• Greyscale dilation brightens small dark areas, and
very small dark "holes" might be totally removed.
• Working with a 3x3 structuring element as above,
greyscale dilation is implemented as follows:
– the numerical values of the point and its eight
neighbours are evaluated
– maximal value of these 9 values is found
– the new value of the point is set to the maximal value
GREYSCALE DILATION EXAMPLE
• On the left side there is the original image, on
the right side is the dilated image.
GREYSCALE OPENING AND CLOSING
• Greyscale opening is, like its binary
counterpart, achieved by first eroding the
image with the structuring element, and then
dilating the resulting image by the structuring
element.
• The process darkens small bright areas, and
may entirely remove very small bright spots
like noise spikes.
GREYSCALE OPENING EXAMPLE
• On the left side there is the original image, on
the right side is the opened image.
GREYSCALE CLOSING
• Greyscale closing is, like its binary
counterpart, achieved by first dilating the
image with the structuring element, and then
eroding the resulting image by the structuring
element.
• The process brightens small dark areas, and
may entirely remove very small dark "holes".
GREYSCALE CLOSING EXAMPLE
• On the left side there is the original image, on
the right side is the closed image.
Hit-and-Miss Transform
• The hit-and-miss transform is a general binary
morphological operation that can be used to
look for particular patterns of foreground and
background pixels in an image.
Hit-and-Miss Transform
• It is actually the basic operation of binary
morphology since almost all the other binary
morphological operators can be derived from
it.
• As with other binary morphological operators
it takes as input a binary image and
a structuring element, and produces another
binary image as output.
Hit-and-Miss Transform
• The structuring element used in the hit-and-miss is a
slight extension to the type that has been introduced
for erosion and dilation, in that it can contain both
foreground and background pixels, rather than just
foreground pixels, i.e. both ones and zeros.
• Four structuring elements used for corner finding in
binary images using the hit-and-miss transform. Note
that they are really all the same element, but rotated
by different amounts.
QUESTIONS

Contenu connexe

Tendances

Tendances (20)

Histogram Equalization
Histogram EqualizationHistogram Equalization
Histogram Equalization
 
Smoothing Filters in Spatial Domain
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
 
Morphological Image Processing
Morphological Image ProcessingMorphological Image Processing
Morphological Image Processing
 
Sharpening using frequency Domain Filter
Sharpening using frequency Domain FilterSharpening using frequency Domain Filter
Sharpening using frequency Domain Filter
 
Edge detection
Edge detectionEdge detection
Edge detection
 
Image segmentation
Image segmentation Image segmentation
Image segmentation
 
Noise Models
Noise ModelsNoise Models
Noise Models
 
Digital Image Processing
Digital Image ProcessingDigital Image Processing
Digital Image Processing
 
Image Enhancement in Spatial Domain
Image Enhancement in Spatial DomainImage Enhancement in Spatial Domain
Image Enhancement in Spatial Domain
 
Image restoration and degradation model
Image restoration and degradation modelImage restoration and degradation model
Image restoration and degradation model
 
Histogram processing
Histogram processingHistogram processing
Histogram processing
 
image enhancement
 image enhancement image enhancement
image enhancement
 
Hit and-miss transform
Hit and-miss transformHit and-miss transform
Hit and-miss transform
 
Digital Image restoration
Digital Image restorationDigital Image restoration
Digital Image restoration
 
Edge Detection and Segmentation
Edge Detection and SegmentationEdge Detection and Segmentation
Edge Detection and Segmentation
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 
Hough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul IslamHough Transform By Md.Nazmul Islam
Hough Transform By Md.Nazmul Islam
 
Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)Spatial Filters (Digital Image Processing)
Spatial Filters (Digital Image Processing)
 
Region Splitting and Merging Technique For Image segmentation.
Region Splitting and Merging Technique For Image segmentation.Region Splitting and Merging Technique For Image segmentation.
Region Splitting and Merging Technique For Image segmentation.
 
Region based segmentation
Region based segmentationRegion based segmentation
Region based segmentation
 

Similaire à Morphological operations

dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
YogeshNeelappa2
 
JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2
Jonathan Westlake
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
Ayaelshiwi
 

Similaire à Morphological operations (20)

morphological image processing
morphological image processingmorphological image processing
morphological image processing
 
Morphological Operations (2).pptx
Morphological Operations (2).pptxMorphological Operations (2).pptx
Morphological Operations (2).pptx
 
Digital image processing techniques
Digital image processing techniquesDigital image processing techniques
Digital image processing techniques
 
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
 
Digital image processing DIP
Digital image processing DIPDigital image processing DIP
Digital image processing DIP
 
CV_Chap 3 Features Detection
CV_Chap 3 Features DetectionCV_Chap 3 Features Detection
CV_Chap 3 Features Detection
 
JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2JonathanWestlake_ComputerVision_Project2
JonathanWestlake_ComputerVision_Project2
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Practical Digital Image Processing 2
Practical Digital Image Processing 2Practical Digital Image Processing 2
Practical Digital Image Processing 2
 
Morphological image processing
Morphological image processingMorphological image processing
Morphological image processing
 
Linear Image Processing
Linear Image Processing Linear Image Processing
Linear Image Processing
 
Lecture 15 image morphology examples
Lecture 15 image morphology examplesLecture 15 image morphology examples
Lecture 15 image morphology examples
 
2. filtering basics
2. filtering basics2. filtering basics
2. filtering basics
 
Noise Removal with Morphological Operations Opening and Closing Using Erosio...
Noise Removal with Morphological Operations Opening and  Closing Using Erosio...Noise Removal with Morphological Operations Opening and  Closing Using Erosio...
Noise Removal with Morphological Operations Opening and Closing Using Erosio...
 
Lec_9_ Morphological ImageProcessing .pdf
Lec_9_ Morphological ImageProcessing .pdfLec_9_ Morphological ImageProcessing .pdf
Lec_9_ Morphological ImageProcessing .pdf
 
Erosion and dilation
Erosion and dilationErosion and dilation
Erosion and dilation
 
Machine Perception with cognition
Machine Perception with cognitionMachine Perception with cognition
Machine Perception with cognition
 
OpenCV presentation series- part 4
OpenCV presentation series- part 4OpenCV presentation series- part 4
OpenCV presentation series- part 4
 
morphological tecnquies in image processing
morphological tecnquies in image processingmorphological tecnquies in image processing
morphological tecnquies in image processing
 
Simultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color ImagesSimultaneous Smoothing and Sharpening of Color Images
Simultaneous Smoothing and Sharpening of Color Images
 

Plus de National Institute of Technology Durgapur (11)

Digital image processing 2
Digital image processing   2Digital image processing   2
Digital image processing 2
 
Digital image processing - OLD
Digital image processing - OLDDigital image processing - OLD
Digital image processing - OLD
 
Cs 331 Data Structures
Cs 331 Data StructuresCs 331 Data Structures
Cs 331 Data Structures
 
Prog lang-c
Prog lang-cProg lang-c
Prog lang-c
 
Computer and Information Technology
Computer and Information TechnologyComputer and Information Technology
Computer and Information Technology
 
Punctuations
PunctuationsPunctuations
Punctuations
 
Biometrics
BiometricsBiometrics
Biometrics
 
Computer vision
Computer visionComputer vision
Computer vision
 
Database design for HPC
Database design for HPCDatabase design for HPC
Database design for HPC
 
Human computer interaction
Human computer interactionHuman computer interaction
Human computer interaction
 
Natural language processing
Natural language processingNatural language processing
Natural language processing
 

Dernier

Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Dernier (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

Morphological operations

  • 1. Morphological Operations Dr. Chandran Saravanan, NIT Durgapur, India Dr.cs1973@gmail.com
  • 2. Overview • morphology is a tool for extracting image components • useful in the description of region shape, such as boundaries, skeletons, and convex hulls • mathematical morphology is set theory, it can apply directly to binary (two-level) images – either in the set (a pixel is set, or put to foreground) – or it isn't (a pixel is reset, or put to background) • the usual set operators (intersection, union, inclusion, complement) can be applied to them
  • 3. Overview continues • Basic operations in mathematical morphology operate on two sets: – the first one is the image, and – the second one is the structuring element • The structuring element used in practice is generally much smaller than the image, often a 3x3 matrix • Applied on greyscale images too
  • 4. EROSION • The basic effect of erosion operator on a binary image is to erode away the boundaries of foreground pixels (usually the white pixels). • Thus areas of foreground pixels shrink in size, and "holes" within those areas become larger. • Mathematically, erosion of set A by set B is a set of all points x such that B translated by x is still contained in A.
  • 5. EROSION continues • Let foreground pixels be represented by logical 1's, and background pixels by logical 0's. • As a practical example, take a 3x3 matrix of logical 1's, with the middle point chosen as the origin of the set is used as the structuring element B (see the following picture). • To compute the erosion of a binary input image by this structuring element, consider each of the foreground pixels in the input image in turn.
  • 6.
  • 8. EROSION continues • For each input pixel we superimpose the structuring element on top of the input image so that the origin of the structuring element coincides with the input pixel coordinates. – If the input pixel is set to foreground and all its 8 neighbours are also set to foreground, then the pixel remains set to foreground. – If the input pixel is set to foreground, but at least one of its 8 neighbours is not, the pixel is set to background. – Input pixels set to background remain such. • This operation can be performed on binary images simply by applying a logical AND function.
  • 9. DILATION • The basic effect of dilation on binary images is to enlarge the areas of foreground pixels (i.e. white pixels) at their borders. • The areas of foreground pixels thus grow in size, while the background "holes" within them shrink. • Mathematically, erosion of A by B is the set of all x displacement such that B and A overlap by at least one non-zero element.
  • 10. DILATION continues • Again let us take a 3x3 matrix for the structuring element, with the center pixel used as the origin of the set. B, then the dilation can be performed using the logical OR function: – If the pixel is set to foreground, it remains such. – If the pixel is set to background, but at least one of its eight neighbours is set to foreground, the pixel is converted to foreground. – If the pixel is set to background and none of its eight neighbours is set to foreground, the pixel remains set to background.
  • 11.
  • 13. OPENING AND CLOSING • The opening is a composite operator, constructed from the two basic operators described above. • Opening of set A by set B is achieved by first the eroding set A by B, then dilating the resulting set by B.
  • 14.
  • 16. CLOSING • The closing, like opening, is also a composite operator. • The closing of set A by set B is achieved by first dilating of set A by B, then eroding the resulting set by B.
  • 18. BOUNDARY EXTRACTION • The boundary of set A can be found by first eroding A by B, then taking the set difference between the original A and the eroded A.
  • 20. GREYSCALE IMAGES • The ideas above can be extended to greyscale images as well. • In greyscale images, each pixel can have the value in a certain range, i.e. 0 to 255, with 0 representing black and 255 representing white.
  • 21. GREYSCALE EROSION AND DILATION • Greyscale erosion is analogous to its binary counterpart. • Greyscale erosion darkens small bright areas, and very small bright areas like noise spikes or small spurs might be totally removed. • Working with a 3x3 structuring element as above, greyscale erosion is implemented as follows: – the numerical values of the point and its eight neighbours are evaluated – minimal value of these 9 values is found – the new value of the point is set to the minimal value
  • 22. GREYSCALE EROSION EXAMPLE • On the left side there is the original image, on the right side is the eroded image.
  • 23. GREYSCALE DILATION • Greyscale dilation brightens small dark areas, and very small dark "holes" might be totally removed. • Working with a 3x3 structuring element as above, greyscale dilation is implemented as follows: – the numerical values of the point and its eight neighbours are evaluated – maximal value of these 9 values is found – the new value of the point is set to the maximal value
  • 24. GREYSCALE DILATION EXAMPLE • On the left side there is the original image, on the right side is the dilated image.
  • 25. GREYSCALE OPENING AND CLOSING • Greyscale opening is, like its binary counterpart, achieved by first eroding the image with the structuring element, and then dilating the resulting image by the structuring element. • The process darkens small bright areas, and may entirely remove very small bright spots like noise spikes.
  • 26. GREYSCALE OPENING EXAMPLE • On the left side there is the original image, on the right side is the opened image.
  • 27. GREYSCALE CLOSING • Greyscale closing is, like its binary counterpart, achieved by first dilating the image with the structuring element, and then eroding the resulting image by the structuring element. • The process brightens small dark areas, and may entirely remove very small dark "holes".
  • 28. GREYSCALE CLOSING EXAMPLE • On the left side there is the original image, on the right side is the closed image.
  • 29. Hit-and-Miss Transform • The hit-and-miss transform is a general binary morphological operation that can be used to look for particular patterns of foreground and background pixels in an image.
  • 30. Hit-and-Miss Transform • It is actually the basic operation of binary morphology since almost all the other binary morphological operators can be derived from it. • As with other binary morphological operators it takes as input a binary image and a structuring element, and produces another binary image as output.
  • 31. Hit-and-Miss Transform • The structuring element used in the hit-and-miss is a slight extension to the type that has been introduced for erosion and dilation, in that it can contain both foreground and background pixels, rather than just foreground pixels, i.e. both ones and zeros. • Four structuring elements used for corner finding in binary images using the hit-and-miss transform. Note that they are really all the same element, but rotated by different amounts.
  • 32.