661e432fd7a2bWeek6,7.pdf digital image processing

haidersheraz99 18 views 42 slides Jul 10, 2024
Slide 1
Slide 1 of 42
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42

About This Presentation

It the slides of digital image processing


Slide Content

Digital Image Processing
Spring 2024
1Zulaikha Kiran, 2024

Material taken from:
Digital Image Processing by Gonzalez and Woods –4
th
Edition
Week 6, 7
2Zulaikha Kiran, 2024

Morphological Image Processing
3Zulaikha 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
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

•MorphologicalImageprocessingislikespatialfiltering,inthatthe
structuringelementismovedlikeawindowacrossthewholeimage,
tofindvaluesofpixelsinanewimage.
•Thevalueofthisnewpixeldependsontheoperationperformed
6Zulaikha Kiran, 2024

Basic Morphological Operations
•Erosion
•ErosionofAbyBisthesetofallpointszsuchthatB,translatedbyz,is
containedinA
•Inabinaryimage,ifanyofthepixel(intheneighbourhooddefinedby
structuringelement)is0,thenoutputis0
•Dilation
•DilationofAbyBisthesetofalldisplacements,z,suchthattheforeground
elementsofB̂overlapatleastoneelementofA
7Zulaikha 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
9Zulaikha Kiran, 2024

Zulaikha Kiran, 2024 10
Input Image Output Image
Structuring Element
https://penny-xu.github.io/blog/mathematical-
morphology

Erosion
11Zulaikha 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

Dilation
•Dilationofimagefbystructuringelementsisgivenbyf⊕s
•Thestructuringelementsispositionedwithitsoriginat(x,y)andthenewpixel
valueisdeterminedusingtherule:
•��,�=
1??????��ℎ??????���
0??????�ℎ���??????��
•Foreachbackgroundpixelsuperimposethestructuringelementontopofthe
inputimagesothattheoriginofthestructuringelementcoincideswiththeinput
pixelposition
•Ifatleastonepixelinthestructuringelementcoincideswithaforegroundpixelin
theimageunderneath,thentheinputpixelissettotheforegroundvalue
•Ifallthecorrespondingpixelsintheimagearebackground,however,theinput
pixelisleftatthebackgroundvalue
15Zulaikha Kiran, 2024

Dilation
16Zulaikha Kiran, 2024

Zulaikha Kiran, 2024 17
Input Image Output Image
Structuring Element
https://penny-xu.github.io/blog/mathematical-
morphology

Dilation
18Zulaikha Kiran, 2024

•Dilation can
•Repair breaks
•Repair intrusions
•Enlarge objects
19Zulaikha Kiran, 2024

20Zulaikha Kiran, 2024

Compound Operators
•Combinations of erosion and dilation
•Opening
•Closing
21Zulaikha Kiran, 2024

Opening
•Erosion followed by dilation
•Denoted by f⃝s
•f⃝s = (f⊖ s)⊕s
22Zulaikha Kiran, 2024

Opening
23Zulaikha Kiran, 2024

Closing
•Dilation followed by erosion
•Denoted by f●s
•f●s = (f⊕ s)⊖ s
24Zulaikha Kiran, 2024

Closing
25Zulaikha Kiran, 2024

26Zulaikha Kiran, 2024

Hit or Miss Transform
•I ◉B= {z|(B )
Z ⊆I }
27Zulaikha Kiran, 2024

28Zulaikha Kiran, 2024

29Zulaikha Kiran, 2024

Morphological Algorithms
•Boundary Extraction
•Region Filling
•Connected Components Extraction
•Skeleton Extraction
30Zulaikha Kiran, 2024

Boundary Extraction
•TheboundaryofsetAdenotedbyβ(A)isobtainedbyfirsterodingA
byasuitablestructuringelementBandthentakingthedifference
betweenAanditserosion.
•ꞵ(A) = A–(A⊖ B)
31Zulaikha 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

Skeleton
39Zulaikha Kiran, 2024

40Zulaikha Kiran, 2024

41Zulaikha Kiran, 2024

End
42Zulaikha Kiran, 2024
Tags