4_14755_CS213_20172018_1__2_1_Lecture_5.ppt

ratnababum 30 views 56 slides Sep 16, 2024
Slide 1
Slide 1 of 56
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
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56

About This Presentation

DIP


Slide Content

Lecture 5
Morphological Image
Processing
Digital Image Processing

Remember
GRAY LEVEL THRESHOLDING
Objects
Set threshold
here

BINARY IMAGE
Problem here
How do we fill “missing pixels”?

Mathematic Morphology
mathematical framework used for:
•pre-processing
–noise filtering, shape simplification, ...
•enhancing object structure
–skeletonization, convex hull...
•Segmentation
–watershed,…
•quantitative description
–area, perimeter, ...
4

Z
2
and Z
3
•set in mathematic morphology represent
objects in an image
–binary image (0 = white, 1 = black) : the element
of the set is the coordinates (x,y) of pixel belong
to the object  Z
2
•gray-scaled image : the element of the set is the
coordinates (x,y) of pixel belong to the object and
the gray levels  Z
3
5

Basic Set Theory
6

Reflection and Translation
7
} ,|{
ˆ
Bfor bbwwB 
} ,|{)( Afor azaccA
z


Example
8

Structuring element (SE)
9
 small set to probe the image under study
 for each SE, define origo
 shape and size must be adapted to geometric
properties for the objects

Examples: Structuring Elements
10
origin

Basic idea
•in parallel for each pixel in binary image:
–check if SE is ”satisfied”
–output pixel is set to 0 or 1 depending on used
operation
11

Example
12
Origin of B visits
every element of A
At each location of the origin of
B, if B is completely contained in
A, then the location is a member
of the new set, otherwise it is
not a member of the new set.

Basic morphological operations
•Erosion
•Dilation
•combine to
–Opening object
–Closening background
13
keep general shape but
smooth with respect to

Erosion
•Does the structuring element fit the set?
erosion of a set A by structuring element B: all z
in A such that B is in A when origin of B=z
shrink the object
14

Erosion
15

Erosion
16

Erosion
17

Erosion
18
}{ Az|(B)BA
z


Dilation
•Does the structuring element hit the set?
•the dilation of A by B can be understood as the
locus of the points covered by B when the
center of B moves inside A.
•grow the object
19
}
ˆ
{ ΦA)Bz|(BA
z 

Dilation
20

Dilation
21

Dilation
22

Dilation
23
}
ˆ
{ ΦA)Bz|(BA
z 
B = structuring element

Dilation : Bridging gaps
24

25

26

27

28

useful
•erosion
–removal of structures of certain shape and size,
given by SE
•Dilation
–filling of holes of certain shape and size, given by
SE
29

Combining erosion and dilation
•WANTED:
–remove structures / fill holes
–without affecting remaining parts
•SOLUTION:
•combine erosion and dilation
•(using same SE)
30

Erosion : eliminating irrelevant detail
31
structuring element B = 13x13 pixels of gray level 1

Opening
erosion followed by dilation, denoted

•eliminates protrusions
•breaks necks
•smoothes contour
32
BBABA  )(

Opening
33

Opening
34

Opening
35
BBABA  )(
})(|){( ABBBA
zz


Opening with a 11 pixel diameter disc:
3x9 and 9x3 Structuring Element
Opening example

Closing
dilation followed by erosion, denoted •
•smooth contour
•fuse narrow breaks and long thin gulfs
•eliminate small holes
•fill gaps in the contour
37
BBABA  )(

Closing
38

Closing
39

Closing
40
BBABA  )(

Closing operation with a 22 pixel disc, closes small holes in
the foreground.
Another closing example

Threshold, closing with disc of size 20.
Note that opening is the dual of closing i.e. opening the
foreground pixels with a particular structuring element is
equivalent to closing the background pixels with the same
element.
And another…

Properties
43
Opening
(i) AB is a subset (subimage) of A
(ii) If C is a subset of D, then C B is a subset of D B
(iii) (A B) B = A B
Closing
(i) A is a subset (subimage) of AB
(ii) If C is a subset of D, then C B is a subset of D B
(iii) (A B) B = A B
Note: repeated openings/closings has no effect!

46

Useful: open & close
47

APPLICATIONS
48

Application: filtering
49

Used to look for particular patterns of foreground and
background pixels
Very simple object recognition
Example for a Hit-and-miss Structuring Element: Contains
0s, 1s and don’t care’s.
Similar to Pattern Matching:
If foreground and background pixels in the structuring
element exactly match foreground and background pixels
in the image, then the pixel underneath the origin of the
structuring element is set to the foreground colour.
Hit-and-miss transform*

Structuring Elements representing four corners.
Apply each Structuring Element.
Use OR operation to combine the four results.
Hit-and-miss example: corner detection

Boundary Extraction
52
)()( BAAA 

Example
53

Region Filling
54
,...3,2,1 )(
1


kABXX
c
kk

Region Filling Algorithm
55

Example
56

Thinning
57
c
BAA
BAABA
)(
)(



Thickening
58
)(BAABA 
•The thickening operation is calculated by translating the origin of the structuring element to each possible
pixel position in the image, and at each such position comparing it with the underlying image pixels. If the
foreground and background pixels in the structuring element exactly match foreground and background
pixels in the image, then the image pixel underneath the origin of the structuring element is set to
foreground (one). Otherwise it is left unchanged. Note that the structuring element must always have a zero
or a blank at its origin if it is to have any effect.
Alternativel
y, based on
Thining
Tags