Some practical uses
of morphology
It is possible to segment an image into regions
of common attribute by detecting the boundary
of each region for which there is a significant
change in attribute across the boundary
2
3
Boundary of an
object
Consists of pixels that
belong to the object(s) itself
Consists of pixels that
belong to the background
Relation??
They are same
4
Boundary of set A
β(A)
1. Erode A by B
2. Perform set difference between A & its
erosion
Example
Input image
Output Image
Structure element used is a 3X3 all 1s matrix
5
6
7
8
Let A be a set. It contains a subset whose
elements are 8-connected boundary
points of a region.
All non-boundary points are labelled 0.
Set A
9
Beginning with a point p inside the
boundary, the objective is to fill the
entire region with 1s.
A value 1 is assigned to the point p (p is an
arbitrarily selected point inside the boundary)
p
10
Set Ac
The region is filled with 1s by the
following procedure.
Xk = (Xk-1 B) ∩ Ac for k = 1, 2, …
where X0 = p
Structuring element
B
origin
11
Structuring element
B
origin
X0
12
∩
Set Ac
X1
13
The algorithm terminates at iteration
step k if Xk = Xk-1.
The set union of Xk and A contains the
filled set & its boundary.
The dilation process would fill the entire area if left
unchecked.
The intersection with Ac at each step limits the result to
inside the region of interest.
14
15
16
Extraction of connected components
in a binary image is central to many
automated image analysis
applications
17
Let A be a set and Y be a connected component in it.
Point p of Y is known.
The following iterative expression yields all the elements
of Y.
Set A
p
Y
X0 = p
X
Structuring
element B
18
19
Set A is said to be convex, if
the straight line segment
joining any two points in A lies
entirely within A
20
The convex hull H of an arbitrary set
S is the smallest convex set
containing S
The set difference H – S is called the
convex deficiency of S
Convex hull & Convex
deficiency
useful for object description
21
Algorithm for obtaining Convex
Hull, C(A), of a set A
 There are four convex hull masks, where 1
represents black, 0 represents white and X
represents a pixel that doesn’t matter, either
0 or 1.
1 x x
1 0 x
1 x x
1 1 1
x 0 x
x x x
x x 1
x 0 1
x x 1
x x x
x 0 x
1 1 1
B1 B2
B3 B4
22
 The procedure consists of implementing the
following equation
Note: converged means when
• Where A represents iteratively applying the hit-or-miss
transform with the 4 masks.
• When the masks produce no more changes, the union is
performed between all 4 masks and the result becomes Di
+1
+1
23
Convex Hull Masks
 Convex hull uses the hit or miss
function
 If any of these masks are found in the
image, then that middle pixel on the
image is replaced with a 1 or black
respectively.
 To achieve the complete convex hull
image, these masks must be applied
repeatedly until no further changes
occur.
24
25
1 x x
1 0 x
1 x x
B1
26
1 1 1
x 0 x
x x x
B2
27
x x 1
x 0 1
x x 1
B3
28
x x x
x 0 x
1 1 1
B4
29
30
To reduce this effect limit growth so that it
does not extend past the vertical &
horizontal dimensions of the original set
of points
31
32
Boundaries of greater complexity can be
used to limit growth even further in
images with more detail.
e.g. the maximum dimensions of the original
set of points along vertical, horizontal &
diagonal directions can be used.
Price paid for such refinements ??
Additional complexity
33
34
Thinning: from many pixels width to
just one
• Much work has been done on the thinning
of ``thick'' binary images,
• where attempts are made to reduce shape
outlines which are many pixels thick to
outlines which are only one pixel thick.
Thinning of thick binary images
35
Erase black pixels such that
An object without holes erodes to a
minimally connected stroke located
equidistant from its nearest outer
boundaries
An object with holes erodes to a
minimally connected ring midway between
each hole & its nearest outer boundary.
Thinning is used to remove selected
foreground pixels from binary images
36
Thinning
Original
image
Thinned
image
37
Applying thinning to
fault detection in PCB
All lines are thinned to one pixel width
Now you can check connectivity
38
Thinning is basically a search & delete process.
It removes only those boundary pixels from the
image whose deletion
Does not change connectivity of their
neighbours locally and
Does not reduce the length of an already
thinned curve
Critical pixel
Its deletion changes the
connectivity of its
neighbourhood locally
End pixel
Its deletion reduces the length
of an already thinned curve.
The no. of neighbouring pixels
of an end pixel are ??
39
Some boundary pixels
0 1 1
0 1 1
0 1 0
0 1 1
0 1 1
1 0 0
0 1 0
0 1 0
0 1 0
0 1 0
0 1 0
0 0 1
0 1 0
0 1 1
0 0 0
0 0 0
0 1 1
0 0 0
0 0 0
0 1 0
0 0 1
(a) (b) (c) (d)
(e) (f) (g)
The image A is
8-connected
The centre pixel of which windows is a
critical pixel ?
(b), (c), (d)
40
0 1 1
0 1 1
0 1 0
0 1 1
0 1 1
1 0 0
0 1 0
0 1 0
0 1 0
0 1 0
0 1 0
0 0 1
0 1 0
0 1 1
0 0 0
0 0 0
0 1 1
0 0 0
0 0 0
0 1 0
0 0 1
(a) (b) (c) (d)
(e) (f) (g)
The centre pixel of which windows is a
end pixel ?
(f), (g)
41
0 1 1
0 1 1
0 1 0
0 1 1
0 1 1
1 0 0
0 1 0
0 1 0
0 1 0
0 1 0
0 1 0
0 0 1
0 1 0
0 1 1
0 0 0
0 0 0
0 1 1
0 0 0
0 0 0
0 1 0
0 0 1
(a) (b) (c) (d)
(e) (f) (g)
The centre pixel of which windows can be
deleted without affecting local connectivity
of the neighbourhood or reducing the length
of the arc?
(a), (e)
42
0 1 1
0 1 1
0 1 0
0 1 1
0 1 1
1 0 0
(a) (b)
What happens to the centre pixels when we
consider the image A to be 4-connected?
In (a) the centre pixel becomes critical,
while in (b) it is not
43
44
45
46
47
Thinning removes only those boundary pixels from the image
whose deletion
Does not change connectivity of their neighbours locally and
Does not reduce the length of an already thinned curve
The deletion of all boundary pixels that satisfy the
above criteria should be done simultaneously to
ensure symmetry in the resultant skeleton.
However, such strategy may delete completely a
curve segment such as the one given below since all
the pixels satisfy the above criteria.
1 1 1 1 1 1
1 1 1 1 1 1
48
Solutio
n to the
proble
m
Apply the deletion process
simultaneously to all boundary
pixels of a particular side (N, S,
E or W)
How to find out the pixels
of the north boundary?
Pixel (x,y) is in the north boundary
if pixel (x, y+1) is in Ac
When is pixel (x, y) in the S, E or W boundary?
1 1 1
1 1
1 1
1 1 1
X
49
50
The thinning of a set A by a
structuring element B can be defined
in terms of the
hit-or-miss transform
51
A more useful expression for
thinning A symmetrically
Use a sequence of structuring elements
{B} = {B1, B2, ..., Bn}
where Bi is the rotated version of Bi-1
52
Thinning
Thinning is often accomplished
using a sequence of rotated
structuring elements (a). Given
a set A (b), results of thinning
with first element is shown in
(c), and the next 7 elements (d)
– (i). There is no change
between 7th and 8th elements,
and no change after first 3
elements. Then it converges to
a m-connectivity.
 
   
   
 
 
n
n
B
B
B
A
B
A
B
B
B
B
B
A
hitnmiss
A
B
A












2
1
2
1
,
,
,
53
Thickening is the morphological dual of thinning
Thickening can also be defined as
a sequential operation
54
A separate algorithm is rarely
used for thickening
The usual procedure??
Thin the background of the set in
question & then take the complement
of the result
To thicken A
 Let C = Ac
 Thin C
 Take Cc

More Related Content

PPTX
Chapter 9 newer
PDF
Digital Image Processing- morphological processing ppt
PPTX
Chapter 9 morphological image processing
PPTX
Chapter 9 morphological image processing
PPTX
Chapter 9 morphological image processing
PDF
IMPROVED PARALLEL THINNING ALGORITHM TO OBTAIN UNIT-WIDTH SKELETON
PPTX
Morphological image Processing
Chapter 9 newer
Digital Image Processing- morphological processing ppt
Chapter 9 morphological image processing
Chapter 9 morphological image processing
Chapter 9 morphological image processing
IMPROVED PARALLEL THINNING ALGORITHM TO OBTAIN UNIT-WIDTH SKELETON
Morphological image Processing

Similar to DIP_14_54_boundary extraction in dip .ppt (20)

PPT
morphological image processing
PDF
A novel embedded hybrid thinning algorithm for
PPT
Lec07-CH9-MORPHOL [Recovered].ppt
PPT
Chapter_9_Morphological_Image_Processing.ppt
PPTX
Machine Perception with cognition
PPT
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
PPT
4_14755_CS213_20172018_1__2_1_Lecture_5.ppt
DOCX
The Digital Image Processing Q@A
PDF
Biomedical engineering 20230918-Fundamentals.pdf
PPTX
Representation image
PDF
Two Dimensional Shape and Texture Quantification - Medical Image Processing
PPTX
Lec7_AIP.pptx6666666666666666666666666666666666666666666666
PPT
Morphology gonzalez-woods
PPTX
Morphological image processing basic.pptx
PDF
Morphological.pdf
PPTX
Morphological Operations (2).pptx
PPT
morphological image processing
PDF
Module 2 Computer Vision: Image Processing
PPTX
representation.pptx
PPT
ComputerVision4_Howie Choset_Renata Melamud.ppt
morphological image processing
A novel embedded hybrid thinning algorithm for
Lec07-CH9-MORPHOL [Recovered].ppt
Chapter_9_Morphological_Image_Processing.ppt
Machine Perception with cognition
dokumen.tips_computer-graphics-image-processing-chapter-9-computer-graphics-i...
4_14755_CS213_20172018_1__2_1_Lecture_5.ppt
The Digital Image Processing Q@A
Biomedical engineering 20230918-Fundamentals.pdf
Representation image
Two Dimensional Shape and Texture Quantification - Medical Image Processing
Lec7_AIP.pptx6666666666666666666666666666666666666666666666
Morphology gonzalez-woods
Morphological image processing basic.pptx
Morphological.pdf
Morphological Operations (2).pptx
morphological image processing
Module 2 Computer Vision: Image Processing
representation.pptx
ComputerVision4_Howie Choset_Renata Melamud.ppt
Ad

Recently uploaded (20)

PDF
Java Basics-Introduction and program control
PDF
August 2025 - Top 10 Read Articles in Network Security & Its Applications
PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PDF
Introduction to Power System StabilityPS
PPTX
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
PPTX
Management Information system : MIS-e-Business Systems.pptx
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
Computer organization and architecuture Digital Notes....pdf
PDF
Design of Material Handling Equipment Lecture Note
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
Computer System Architecture 3rd Edition-M Morris Mano.pdf
PPTX
Principal presentation for NAAC (1).pptx
PDF
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
PDF
First part_B-Image Processing - 1 of 2).pdf
PDF
20250617 - IR - Global Guide for HR - 51 pages.pdf
PDF
Soil Improvement Techniques Note - Rabbi
PPTX
wireless networks, mobile computing.pptx
PPTX
ai_satellite_crop_management_20250815030350.pptx
PDF
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Java Basics-Introduction and program control
August 2025 - Top 10 Read Articles in Network Security & Its Applications
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Introduction to Power System StabilityPS
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
Management Information system : MIS-e-Business Systems.pptx
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
Computer organization and architecuture Digital Notes....pdf
Design of Material Handling Equipment Lecture Note
distributed database system" (DDBS) is often used to refer to both the distri...
Computer System Architecture 3rd Edition-M Morris Mano.pdf
Principal presentation for NAAC (1).pptx
Prof. Dr. KAYIHURA A. SILAS MUNYANEZA, PhD..pdf
First part_B-Image Processing - 1 of 2).pdf
20250617 - IR - Global Guide for HR - 51 pages.pdf
Soil Improvement Techniques Note - Rabbi
wireless networks, mobile computing.pptx
ai_satellite_crop_management_20250815030350.pptx
LOW POWER CLASS AB SI POWER AMPLIFIER FOR WIRELESS MEDICAL SENSOR NETWORK
Ad

DIP_14_54_boundary extraction in dip .ppt

  • 2. It is possible to segment an image into regions of common attribute by detecting the boundary of each region for which there is a significant change in attribute across the boundary 2
  • 3. 3 Boundary of an object Consists of pixels that belong to the object(s) itself Consists of pixels that belong to the background Relation?? They are same
  • 4. 4 Boundary of set A β(A) 1. Erode A by B 2. Perform set difference between A & its erosion
  • 5. Example Input image Output Image Structure element used is a 3X3 all 1s matrix 5
  • 6. 6
  • 7. 7
  • 8. 8 Let A be a set. It contains a subset whose elements are 8-connected boundary points of a region. All non-boundary points are labelled 0. Set A
  • 9. 9 Beginning with a point p inside the boundary, the objective is to fill the entire region with 1s. A value 1 is assigned to the point p (p is an arbitrarily selected point inside the boundary) p
  • 10. 10 Set Ac The region is filled with 1s by the following procedure. Xk = (Xk-1 B) ∩ Ac for k = 1, 2, … where X0 = p Structuring element B origin
  • 13. 13 The algorithm terminates at iteration step k if Xk = Xk-1. The set union of Xk and A contains the filled set & its boundary. The dilation process would fill the entire area if left unchecked. The intersection with Ac at each step limits the result to inside the region of interest.
  • 14. 14
  • 15. 15
  • 16. 16 Extraction of connected components in a binary image is central to many automated image analysis applications
  • 17. 17 Let A be a set and Y be a connected component in it. Point p of Y is known. The following iterative expression yields all the elements of Y. Set A p Y X0 = p X Structuring element B
  • 18. 18
  • 19. 19 Set A is said to be convex, if the straight line segment joining any two points in A lies entirely within A
  • 20. 20 The convex hull H of an arbitrary set S is the smallest convex set containing S The set difference H – S is called the convex deficiency of S Convex hull & Convex deficiency useful for object description
  • 21. 21 Algorithm for obtaining Convex Hull, C(A), of a set A  There are four convex hull masks, where 1 represents black, 0 represents white and X represents a pixel that doesn’t matter, either 0 or 1. 1 x x 1 0 x 1 x x 1 1 1 x 0 x x x x x x 1 x 0 1 x x 1 x x x x 0 x 1 1 1 B1 B2 B3 B4
  • 22. 22  The procedure consists of implementing the following equation Note: converged means when • Where A represents iteratively applying the hit-or-miss transform with the 4 masks. • When the masks produce no more changes, the union is performed between all 4 masks and the result becomes Di +1 +1
  • 23. 23 Convex Hull Masks  Convex hull uses the hit or miss function  If any of these masks are found in the image, then that middle pixel on the image is replaced with a 1 or black respectively.  To achieve the complete convex hull image, these masks must be applied repeatedly until no further changes occur.
  • 24. 24
  • 25. 25 1 x x 1 0 x 1 x x B1
  • 26. 26 1 1 1 x 0 x x x x B2
  • 27. 27 x x 1 x 0 1 x x 1 B3
  • 28. 28 x x x x 0 x 1 1 1 B4
  • 29. 29
  • 30. 30 To reduce this effect limit growth so that it does not extend past the vertical & horizontal dimensions of the original set of points
  • 31. 31
  • 32. 32 Boundaries of greater complexity can be used to limit growth even further in images with more detail. e.g. the maximum dimensions of the original set of points along vertical, horizontal & diagonal directions can be used. Price paid for such refinements ?? Additional complexity
  • 33. 33
  • 34. 34 Thinning: from many pixels width to just one • Much work has been done on the thinning of ``thick'' binary images, • where attempts are made to reduce shape outlines which are many pixels thick to outlines which are only one pixel thick. Thinning of thick binary images
  • 35. 35 Erase black pixels such that An object without holes erodes to a minimally connected stroke located equidistant from its nearest outer boundaries An object with holes erodes to a minimally connected ring midway between each hole & its nearest outer boundary. Thinning is used to remove selected foreground pixels from binary images
  • 37. 37 Applying thinning to fault detection in PCB All lines are thinned to one pixel width Now you can check connectivity
  • 38. 38 Thinning is basically a search & delete process. It removes only those boundary pixels from the image whose deletion Does not change connectivity of their neighbours locally and Does not reduce the length of an already thinned curve Critical pixel Its deletion changes the connectivity of its neighbourhood locally End pixel Its deletion reduces the length of an already thinned curve. The no. of neighbouring pixels of an end pixel are ??
  • 39. 39 Some boundary pixels 0 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 (a) (b) (c) (d) (e) (f) (g) The image A is 8-connected The centre pixel of which windows is a critical pixel ? (b), (c), (d)
  • 40. 40 0 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 (a) (b) (c) (d) (e) (f) (g) The centre pixel of which windows is a end pixel ? (f), (g)
  • 41. 41 0 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 0 1 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 0 0 1 (a) (b) (c) (d) (e) (f) (g) The centre pixel of which windows can be deleted without affecting local connectivity of the neighbourhood or reducing the length of the arc? (a), (e)
  • 42. 42 0 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 0 0 (a) (b) What happens to the centre pixels when we consider the image A to be 4-connected? In (a) the centre pixel becomes critical, while in (b) it is not
  • 43. 43
  • 44. 44
  • 45. 45
  • 46. 46
  • 47. 47 Thinning removes only those boundary pixels from the image whose deletion Does not change connectivity of their neighbours locally and Does not reduce the length of an already thinned curve The deletion of all boundary pixels that satisfy the above criteria should be done simultaneously to ensure symmetry in the resultant skeleton. However, such strategy may delete completely a curve segment such as the one given below since all the pixels satisfy the above criteria. 1 1 1 1 1 1 1 1 1 1 1 1
  • 48. 48 Solutio n to the proble m Apply the deletion process simultaneously to all boundary pixels of a particular side (N, S, E or W) How to find out the pixels of the north boundary? Pixel (x,y) is in the north boundary if pixel (x, y+1) is in Ac When is pixel (x, y) in the S, E or W boundary? 1 1 1 1 1 1 1 1 1 1 X
  • 49. 49
  • 50. 50 The thinning of a set A by a structuring element B can be defined in terms of the hit-or-miss transform
  • 51. 51 A more useful expression for thinning A symmetrically Use a sequence of structuring elements {B} = {B1, B2, ..., Bn} where Bi is the rotated version of Bi-1
  • 52. 52 Thinning Thinning is often accomplished using a sequence of rotated structuring elements (a). Given a set A (b), results of thinning with first element is shown in (c), and the next 7 elements (d) – (i). There is no change between 7th and 8th elements, and no change after first 3 elements. Then it converges to a m-connectivity.               n n B B B A B A B B B B B A hitnmiss A B A             2 1 2 1 , , ,
  • 53. 53 Thickening is the morphological dual of thinning Thickening can also be defined as a sequential operation
  • 54. 54 A separate algorithm is rarely used for thickening The usual procedure?? Thin the background of the set in question & then take the complement of the result To thicken A  Let C = Ac  Thin C  Take Cc

Editor's Notes

  • #36: William K Pratt
  • #39: The no. of neighbouring pixels of an end pixel are less than two.
  • #49: S – (x, y-1) E – (x-1, y) W – (x+1, y)
  • #51: Woods Gonzalez