•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
4Zulaikha Kiran, 2024
Structuring elements
•A structuring element is a small image –used as a moving window
Structuring elements and their reflections about the origin
5Zulaikha 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.
8Zulaikha Kiran, 2024
•Erosion can split apart joined objects
•Erosion can remove extrusions
•Erosion shrinks objects
12Zulaikha 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.
13Zulaikha Kiran, 2024
•Count the number of objects using MATLAB
14Zulaikha Kiran, 2024
•Boundary extraction using a 3 x 3 square structuring element
32Zulaikha Kiran, 2024
Region Filling
•Ahole may be defined as a background region surrounded by a
connected border of foreground pixels.
•Steps:
•Start from a known point p and take X
0= p,
•Then take the next values of X
kas: X
k= (X
k-1⊕ B ) ⋂ A
C
•Terminate iterations if X
k= X
k-1
•The intersection of dilation and the complement of A limits the result to
inside the region of interest
•The set union of X
kand A contains the filled set and its boundaries
33Zulaikha Kiran, 2024
34Zulaikha Kiran, 2024
35Zulaikha Kiran, 2024
Extraction of connected components
•Steps:
•Start from a known point p and take X
0= p,
•Then take the next values of X
kas: X
k= (X
k-1⊕ B ) ⋂ A
•Terminate iterations if X
k= X
k-1
•The component Y is given as Y = X
k
36Zulaikha Kiran, 2024
37Zulaikha Kiran, 2024
Skeleton
•If z is a point of S(A), and (D)
Zis the largest disk centeredat 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.
38Zulaikha Kiran, 2024