SlideShare a Scribd company logo
Digital Image Processing
Spring 2024
1
Zulaikha Kiran, 2024
Material taken from:
Digital Image Processing by Gonzalez and Woods – 4th Edition
Week 6, 7
2
Zulaikha Kiran, 2024
Morphological Image Processing
3
Zulaikha Kiran, 2024
• In image processing, we use morphology with two types of sets of pixels: objects
and structuring elements (SE’s).
• Typically, objects are defined as sets of foreground pixels.
• Structuring elements can be specified in terms of both foreground and background pixels.
• In forming rectangular arrays for digital image processing we assign a background
value to all pixels that are not members of object sets
4
Zulaikha Kiran, 2024
Structuring elements
• A structuring element is a small image – used as a moving window
Structuring elements and their reflections about the origin
5
Zulaikha Kiran, 2024
• Morphological Image processing is like spatial filtering, in that the
structuring element is moved like a window across the whole image,
to find values of pixels in a new image.
• The value of this new pixel depends on the operation performed
6
Zulaikha Kiran, 2024
Basic Morphological Operations
• Erosion
• Erosion of A by B is the set of all points z such that B, translated by z, is
contained in A
• In a binary image, if any of the pixel (in the neighbourhood defined by
structuring element) is 0, then output is 0
• Dilation
• Dilation of A by B is the set of all displacements, z, such that the foreground
elements of B̂ overlap at least one element of A
7
Zulaikha Kiran, 2024
Erosion
• Erosion of image f by structuring element s is given by f ⊖ s
• The structuring element s is positioned with its origin at (x, y) and the new
pixel value is determined using the rule:
𝑔 𝑥, 𝑦 =
1 𝑖𝑓 𝑠 𝑓𝑖𝑡𝑠 𝑓
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
• For each foreground pixel, superimpose the structuring element on top of
the input image so that the origin of the structuring element coincides with
the input pixel position.
• If for every pixel in the structuring element, the corresponding pixel in the
image underneath is a foreground pixel, then the input pixel is left as it is.
• If any of the corresponding pixels in the image are background, however,
the input pixel is also set to background value.
8
Zulaikha Kiran, 2024
Erosion
9
Zulaikha Kiran, 2024
Zulaikha Kiran, 2024 10
Input Image Output Image
Structuring Element
https://penny-xu.github.io/blog/mathematical-
morphology
Erosion
11
Zulaikha Kiran, 2024
• Erosion can split apart joined objects
• Erosion can remove extrusions
• Erosion shrinks objects
12
Zulaikha Kiran, 2024
Erosion
• A binary image of a wire-
bond mask in which
foreground pixels are shown
in white.
• Image eroded using square
structuring elements of sizes
11x11 15x15 and 45x45
elements, respectively, all
valued 1.
13
Zulaikha Kiran, 2024
• Count the number of objects using MATLAB
14
Zulaikha Kiran, 2024
Dilation
• Dilation of image f by structuring element s is given by f ⊕ s
• The structuring element s is positioned with its origin at (x, y) and the new pixel
value is determined using the rule:
• 𝑔 𝑥, 𝑦 =
1 𝑖𝑓 𝑠 ℎ𝑖𝑡𝑠 𝑓
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
• For each background pixel superimpose the structuring element on top of the
input image so that the origin of the structuring element coincides with the input
pixel position
• If at least one pixel in the structuring element coincides with a foreground pixel in
the image underneath, then the input pixel is set to the foreground value
• If all the corresponding pixels in the image are background, however, the input
pixel is left at the background value
15
Zulaikha Kiran, 2024
Dilation
16
Zulaikha Kiran, 2024
Zulaikha Kiran, 2024 17
Input Image Output Image
Structuring Element
https://penny-xu.github.io/blog/mathematical-
morphology
Dilation
18
Zulaikha Kiran, 2024
• Dilation can
• Repair breaks
• Repair intrusions
• Enlarge objects
19
Zulaikha Kiran, 2024
20
Zulaikha Kiran, 2024
Compound Operators
• Combinations of erosion and dilation
• Opening
• Closing
21
Zulaikha Kiran, 2024
Opening
• Erosion followed by dilation
• Denoted by f ⃝ s
• f ⃝ s = (f ⊖ s) ⊕ s
22
Zulaikha Kiran, 2024
Opening
23
Zulaikha Kiran, 2024
Closing
• Dilation followed by erosion
• Denoted by f ● s
• f ● s = (f ⊕ s) ⊖ s
24
Zulaikha Kiran, 2024
Closing
25
Zulaikha Kiran, 2024
26
Zulaikha Kiran, 2024
Hit or Miss Transform
• I ◉B = {z|(B )Z ⊆I }
27
Zulaikha Kiran, 2024
28
Zulaikha Kiran, 2024
29
Zulaikha Kiran, 2024
Morphological Algorithms
• Boundary Extraction
• Region Filling
• Connected Components Extraction
• Skeleton Extraction
30
Zulaikha Kiran, 2024
Boundary Extraction
• The boundary of set A denoted by β(A) is obtained by first eroding A
by a suitable structuring element B and then taking the difference
between A and its erosion.
• ꞵ(A) = A – (A ⊖ B)
31
Zulaikha Kiran, 2024
• Boundary extraction using a 3 x 3 square structuring element
32
Zulaikha Kiran, 2024
Region Filling
• A hole may be defined as a background region surrounded by a
connected border of foreground pixels.
• Steps:
• Start from a known point p and take X0= p,
• Then take the next values of Xk as: Xk = (Xk-1 ⊕ B ) ⋂ AC
• Terminate iterations if Xk = Xk-1
• The intersection of dilation and the complement of A limits the result to
inside the region of interest
• The set union of Xk and A contains the filled set and its boundaries
33
Zulaikha Kiran, 2024
34
Zulaikha Kiran, 2024
35
Zulaikha Kiran, 2024
Extraction of connected components
• Steps:
• Start from a known point p and take X0= p,
• Then take the next values of Xk as: Xk = (Xk-1 ⊕ B ) ⋂ A
• Terminate iterations if Xk = Xk-1
• The component Y is given as Y = Xk
36
Zulaikha Kiran, 2024
37
Zulaikha Kiran, 2024
Skeleton
• If z is a point of S(A), and (D)Z is the largest disk centered at z and
contained in A, one cannot find a larger disk (not necessarily centered
at z) containing (D)Z and simultaneously included in A. A disk (D)Z
satisfying these conditions is called a maximum disk.
• If (D)Z is a maximum disk, it touches the boundary of A at two or more
different places.
38
Zulaikha Kiran, 2024
Skeleton
39
Zulaikha Kiran, 2024
40
Zulaikha Kiran, 2024
41
Zulaikha Kiran, 2024
End
42
Zulaikha Kiran, 2024

More Related Content

PPTX
Morphological image processing
PPT
4_14755_CS213_20172018_1__2_1_Lecture_5.ppt
PPTX
Morphological Operations (2).pptx
PPT
Boundary Extraction
PPTX
Chapter 9 morphological image processing
PPTX
Chapter 9 morphological image processing
PPT
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
PPTX
Chapter 9 morphological image processing
Morphological image processing
4_14755_CS213_20172018_1__2_1_Lecture_5.ppt
Morphological Operations (2).pptx
Boundary Extraction
Chapter 9 morphological image processing
Chapter 9 morphological image processing
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
Chapter 9 morphological image processing

Similar to 661e432fd7a2bWeek6,7.pdf digital image processing (20)

PPT
Chapter_9_Morphological_Image_Processing.ppt
PPT
morphological tecnquies in image processing
PDF
Morphological.pdf
PPTX
Morphological image processing basic.pptx
PPT
morphological image processing
PPTX
Morphological image Processing
PDF
Lec_9_ Morphological ImageProcessing .pdf
PDF
CV_Chap 3 Features Detection
PPT
DigitalImageProcessing 9-Morphology.ppt
PPT
morphological image processing
PDF
Morphological image processing motes.pdf
PPT
Morphological operations on digital image processing
PPT
EE 583-Lectursssse1sffgdhfdhgdhfdfdg0.ppt
PPT
Lec07-CH9-MORPHOL [Recovered].ppt
PPTX
Lec7_AIP.pptx6666666666666666666666666666666666666666666666
PPTX
Chapter 9 newer
PPT
Morphological Image Processing
PDF
Morphology in graphics and image processing
PPTX
Morphological image processing
Chapter_9_Morphological_Image_Processing.ppt
morphological tecnquies in image processing
Morphological.pdf
Morphological image processing basic.pptx
morphological image processing
Morphological image Processing
Lec_9_ Morphological ImageProcessing .pdf
CV_Chap 3 Features Detection
DigitalImageProcessing 9-Morphology.ppt
morphological image processing
Morphological image processing motes.pdf
Morphological operations on digital image processing
EE 583-Lectursssse1sffgdhfdhgdhfdfdg0.ppt
Lec07-CH9-MORPHOL [Recovered].ppt
Lec7_AIP.pptx6666666666666666666666666666666666666666666666
Chapter 9 newer
Morphological Image Processing
Morphology in graphics and image processing
Morphological image processing
Ad

Recently uploaded (20)

PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
Digital Logic Computer Design lecture notes
PDF
composite construction of structures.pdf
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Sustainable Sites - Green Building Construction
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPT
introduction to datamining and warehousing
PPTX
Safety Seminar civil to be ensured for safe working.
PPTX
Current and future trends in Computer Vision.pptx
PPTX
Geodesy 1.pptx...............................................
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Internet of Things (IOT) - A guide to understanding
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
Digital Logic Computer Design lecture notes
composite construction of structures.pdf
CYBER-CRIMES AND SECURITY A guide to understanding
Sustainable Sites - Green Building Construction
Operating System & Kernel Study Guide-1 - converted.pdf
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
introduction to datamining and warehousing
Safety Seminar civil to be ensured for safe working.
Current and future trends in Computer Vision.pptx
Geodesy 1.pptx...............................................
Ad

661e432fd7a2bWeek6,7.pdf digital image processing

  • 1. Digital Image Processing Spring 2024 1 Zulaikha Kiran, 2024
  • 2. Material taken from: Digital Image Processing by Gonzalez and Woods – 4th Edition Week 6, 7 2 Zulaikha Kiran, 2024
  • 4. • In image processing, we use morphology with two types of sets of pixels: objects and structuring elements (SE’s). • Typically, objects are defined as sets of foreground pixels. • Structuring elements can be specified in terms of both foreground and background pixels. • In forming rectangular arrays for digital image processing we assign a background value to all pixels that are not members of object sets 4 Zulaikha Kiran, 2024
  • 5. Structuring elements • A structuring element is a small image – used as a moving window Structuring elements and their reflections about the origin 5 Zulaikha Kiran, 2024
  • 6. • Morphological Image processing is like spatial filtering, in that the structuring element is moved like a window across the whole image, to find values of pixels in a new image. • The value of this new pixel depends on the operation performed 6 Zulaikha Kiran, 2024
  • 7. Basic Morphological Operations • Erosion • Erosion of A by B is the set of all points z such that B, translated by z, is contained in A • In a binary image, if any of the pixel (in the neighbourhood defined by structuring element) is 0, then output is 0 • Dilation • Dilation of A by B is the set of all displacements, z, such that the foreground elements of B̂ overlap at least one element of A 7 Zulaikha Kiran, 2024
  • 8. Erosion • Erosion of image f by structuring element s is given by f ⊖ s • The structuring element s is positioned with its origin at (x, y) and the new pixel value is determined using the rule: 𝑔 𝑥, 𝑦 = 1 𝑖𝑓 𝑠 𝑓𝑖𝑡𝑠 𝑓 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 • For each foreground pixel, superimpose the structuring element on top of the input image so that the origin of the structuring element coincides with the input pixel position. • If for every pixel in the structuring element, the corresponding pixel in the image underneath is a foreground pixel, then the input pixel is left as it is. • If any of the corresponding pixels in the image are background, however, the input pixel is also set to background value. 8 Zulaikha Kiran, 2024
  • 10. Zulaikha Kiran, 2024 10 Input Image Output Image Structuring Element https://penny-xu.github.io/blog/mathematical- morphology
  • 12. • Erosion can split apart joined objects • Erosion can remove extrusions • Erosion shrinks objects 12 Zulaikha Kiran, 2024
  • 13. Erosion • A binary image of a wire- bond mask in which foreground pixels are shown in white. • Image eroded using square structuring elements of sizes 11x11 15x15 and 45x45 elements, respectively, all valued 1. 13 Zulaikha Kiran, 2024
  • 14. • Count the number of objects using MATLAB 14 Zulaikha Kiran, 2024
  • 15. Dilation • Dilation of image f by structuring element s is given by f ⊕ s • The structuring element s is positioned with its origin at (x, y) and the new pixel value is determined using the rule: • 𝑔 𝑥, 𝑦 = 1 𝑖𝑓 𝑠 ℎ𝑖𝑡𝑠 𝑓 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 • For each background pixel superimpose the structuring element on top of the input image so that the origin of the structuring element coincides with the input pixel position • If at least one pixel in the structuring element coincides with a foreground pixel in the image underneath, then the input pixel is set to the foreground value • If all the corresponding pixels in the image are background, however, the input pixel is left at the background value 15 Zulaikha Kiran, 2024
  • 17. Zulaikha Kiran, 2024 17 Input Image Output Image Structuring Element https://penny-xu.github.io/blog/mathematical- morphology
  • 19. • Dilation can • Repair breaks • Repair intrusions • Enlarge objects 19 Zulaikha Kiran, 2024
  • 21. Compound Operators • Combinations of erosion and dilation • Opening • Closing 21 Zulaikha Kiran, 2024
  • 22. Opening • Erosion followed by dilation • Denoted by f ⃝ s • f ⃝ s = (f ⊖ s) ⊕ s 22 Zulaikha Kiran, 2024
  • 24. Closing • Dilation followed by erosion • Denoted by f ● s • f ● s = (f ⊕ s) ⊖ s 24 Zulaikha Kiran, 2024
  • 27. Hit or Miss Transform • I ◉B = {z|(B )Z ⊆I } 27 Zulaikha Kiran, 2024
  • 30. Morphological Algorithms • Boundary Extraction • Region Filling • Connected Components Extraction • Skeleton Extraction 30 Zulaikha Kiran, 2024
  • 31. Boundary Extraction • The boundary of set A denoted by β(A) is obtained by first eroding A by a suitable structuring element B and then taking the difference between A and its erosion. • ꞵ(A) = A – (A ⊖ B) 31 Zulaikha Kiran, 2024
  • 32. • Boundary extraction using a 3 x 3 square structuring element 32 Zulaikha Kiran, 2024
  • 33. Region Filling • A hole may be defined as a background region surrounded by a connected border of foreground pixels. • Steps: • Start from a known point p and take X0= p, • Then take the next values of Xk as: Xk = (Xk-1 ⊕ B ) ⋂ AC • Terminate iterations if Xk = Xk-1 • The intersection of dilation and the complement of A limits the result to inside the region of interest • The set union of Xk and A contains the filled set and its boundaries 33 Zulaikha Kiran, 2024
  • 36. Extraction of connected components • Steps: • Start from a known point p and take X0= p, • Then take the next values of Xk as: Xk = (Xk-1 ⊕ B ) ⋂ A • Terminate iterations if Xk = Xk-1 • The component Y is given as Y = Xk 36 Zulaikha Kiran, 2024
  • 38. Skeleton • If z is a point of S(A), and (D)Z is the largest disk centered at z and contained in A, one cannot find a larger disk (not necessarily centered at z) containing (D)Z and simultaneously included in A. A disk (D)Z satisfying these conditions is called a maximum disk. • If (D)Z is a maximum disk, it touches the boundary of A at two or more different places. 38 Zulaikha Kiran, 2024