Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer and Robot Vision I

Similar presentations


Presentation on theme: "Computer and Robot Vision I"— Presentation transcript:

1 Computer and Robot Vision I
Chapter 5 Mathematical Morphology Presented by: 傅楸善 & 王彥鈞 指導教授: 傅楸善 博士 Digital Camera and Computer Vision Laboratory Department of Computer Science and Information Engineering National Taiwan University, Taipei, Taiwan, R.O.C.

2 5.1 Introduction mathematical morphology works on shape
shape: prime carrier of information in machine vision morphological operations: simplify image data, preserve essential shape characteristics, eliminate irrelevancies shape: correlates directly with decomposition of object, object features, object surface defects, assembly defects DC & CV Lab. CSIE NTU

3 5.2 Binary Morphology set theory: language of binary mathematical morphology sets in mathematical morphology: represent shapes Euclidean N-space: EN discrete Euclidean N-space: ZN N=2: hexagonal grid, square grid DC & CV Lab. CSIE NTU

4 5.2 Binary Morphology (cont’)
dilation, erosion: primary morphological operations opening, closing: composed from dilation, erosion opening, closing: related to shape representation, decomposition, primitive extraction DC & CV Lab. CSIE NTU

5 DC & CV Lab. CSIE NTU

6 5.2.1 Binary Dilation dilation: combines two sets by vector addition of set elements dilation of A by B: addition commutative  dilation commutative: binary dilation: Minkowski addition DC & CV Lab. CSIE NTU

7 5.2.1 Binary Dilation (cont’)
DC & CV Lab. CSIE NTU

8 5.2.1 Binary Dilation (cont’)
A: referred as set, image B: structuring element: kernel dilation by disk: isotropic swelling or expansion DC & CV Lab. CSIE NTU

9 5.2.1 Binary Dilation (cont’)
DC & CV Lab. CSIE NTU

10 5.2.1 Binary Dilation (cont’)
dilation by kernel without origin: might not have common pixels with A translation of dilation: always can contain A DC & CV Lab. CSIE NTU

11 5.2.1 Binary Dilation (cont’)
=lena.bin.128= DC & CV Lab. CSIE NTU

12 5.2.1 Binary Dilation (cont’)
=lena.bin.dil= By structuring element : DC & CV Lab. CSIE NTU

13 5.2.1 Binary Dilation (cont’)
N4: set of four 4-neighbors of (0,0) but not (0,0) 4-isolated pixels removed only points in I with at least one of its 4-neighbors remain At: translation of A by the point t DC & CV Lab. CSIE NTU

14 5.2.1 Binary Dilation (cont’)
dilation: union of translates of kernel addition associative dilation associative associativity of dilation: chain rule: iterative rule dilation of translated kernel: translation of dilation DC & CV Lab. CSIE NTU

15 5.2.1 Binary Dilation (cont’)
dilation distributes over union dilating by union of two sets: the union of the dilation DC & CV Lab. CSIE NTU

16 5.2.1 Binary Dilation (cont’)
dilating A by kernel with origin guaranteed to contain A extensive: operators whose output contains input dilation extensive when kernel contains origin dilation preserves order increasing: preserves order DC & CV Lab. CSIE NTU

17 5.2.1 Binary Dilation (cont’)
Reader’s Digest Oct.1994, p .73 DC & CV Lab. CSIE NTU

18 5.2.2 Binary Erosion erosion: morphological dual of dilation
erosion of A by B: set of all x s.t. erosion: shrink: reduce: DC & CV Lab. CSIE NTU

19 5.2.2 Binary Erosion (cont’)
DC & CV Lab. CSIE NTU

20 5.2.2 Binary Erosion (cont’)
=lena.bin.128= DC & CV Lab. CSIE NTU

21 5.2.2 Binary Erosion (cont’)
=Lena.bin.ero= DC & CV Lab. CSIE NTU

22 5.2.2 Binary Erosion (cont’)
erosion of A by B: set of all x for which B translated to x contained in A if B translated to x contained in A then x in A B erosion: difference of elements a and b DC & CV Lab. CSIE NTU

23 5.2.2 Binary Erosion (cont’)
dilation: union of translates erosion: intersection of negative translates DC & CV Lab. CSIE NTU

24 5.2.2 Binary Erosion (cont’)
DC & CV Lab. CSIE NTU

25 5.2.2 Binary Erosion (cont’)
Minkowski subtraction: close relative to erosion Minkowski subtraction: erosion: shrinking of the original image antiextensive: operated set contained in the original set erosion antiextensive: if origin contained in kernel DC & CV Lab. CSIE NTU

26 5.2.2 Binary Erosion (cont’)
if then because eroding A by kernel without origin can have nothing in common with A DC & CV Lab. CSIE NTU

27 5.2.2 Binary Erosion (cont’)
DC & CV Lab. CSIE NTU

28 5.2.2 Binary Erosion (cont’)
dilating translated set results in a translated dilation eroding by translated kernel results in negatively translated erosion dilation, erosion: increasing DC & CV Lab. CSIE NTU

29 5.2.2 Binary Erosion (cont’)
eroding by larger kernel produces smaller result Dilation, erosion similar that one does to foreground, the other to background similarity: duality dual: negation of one equals to the other on negated variables DeMorgan’s law: duality between set union and intersection DC & CV Lab. CSIE NTU

30 5.2.2 Binary Erosion (cont’)
Joke 999555 DC & CV Lab. CSIE NTU

31 5.2.2 Binary Erosion (cont’)
negation of a set: complement negation of a set in two possible ways in morphology logical sense: set complement geometric sense: reflection: reversing of set orientation DC & CV Lab. CSIE NTU

32 5.2.2 Binary Erosion (cont’)
complement of erosion: dilation of the complement by reflection Theorem 5.1: Erosion Dilation Duality DC & CV Lab. CSIE NTU

33 5.2.2 Binary Erosion (cont’)
DC & CV Lab. CSIE NTU

34 5.2.2 Binary Erosion (cont’)
Corollary 5.1: erosion of intersection of two sets: intersection of erosions DC & CV Lab. CSIE NTU

35 5.2.2 Binary Erosion (cont’)
DC & CV Lab. CSIE NTU

36 5.2.2 Binary Erosion (cont’)
erosion of a kernel of union of two sets: intersection of erosions erosion of kernel of intersection of two sets: contains union of erosions no stronger DC & CV Lab. CSIE NTU

37 DC & CV Lab. CSIE NTU

38 5.2.2 Binary Erosion (cont’)
chain rule for erosion holds when kernel decomposable through dilation duality does not imply cancellation on morphological equalities containment relationship holds DC & CV Lab. CSIE NTU

39 5.2.2 Binary Erosion (cont’)
genus g(I): number of connected components minus number of holes of I, 4-connected for object, 8-connected for background 8-connected for object, 4-connected for background DC & CV Lab. CSIE NTU

40 5.2.2 Binary Erosion (cont’)
DC & CV Lab. CSIE NTU

41 5.2.2 Binary Erosion (cont’)
DC & CV Lab. CSIE NTU

42 Joke Frisvr DC & CV Lab. CSIE NTU

43 5.2.3 Hit-and-Miss Transform
hit-and-miss: selects corner points, isolated points, border points hit-and-miss: performs template matching, thinning, thickening, centering hit-and-miss: intersection of erosions J,K kernels satisfy hit-and-miss of set A by (J,K) hit-and-miss: to find upper right-hand corner DC & CV Lab. CSIE NTU

44 5.2.3 Hit-and-Miss Transform (cont’)
DC & CV Lab. CSIE NTU

45 DC & CV Lab. CSIE NTU

46 5.2.3 Hit-and-Miss Transform (cont’)
J locates all pixels with south, west neighbors part of A K locates all pixels of Ac that have south, west neighbors in Ac J and K displaced from one another Hit-and-miss: locate particular spatial patterns DC & CV Lab. CSIE NTU

47 5.2.3 Hit-and-Miss Transform (cont’)
hit-and-miss: to compute genus of a binary image DC & CV Lab. CSIE NTU

48 5.2.3 Hit-and-Miss Transform (cont’)
DC & CV Lab. CSIE NTU

49 5.2.3 Hit-and-Miss Transform (cont’)
hit-and-miss: thickening and thinning hit-and-miss: counting hit-and-miss: template matching DC & CV Lab. CSIE NTU

50 The_lion_sleeps_tonight
Joke The_lion_sleeps_tonight DC & CV Lab. CSIE NTU

51 5.2.4 Dilation and Erosion Summary
DC & CV Lab. CSIE NTU

52 5.2.4 Dilation and Erosion Summary (cont’)
DC & CV Lab. CSIE NTU

53 5.2.5 Opening and Closing dilation and erosions: usually employed in pairs B K: opening of image B by kernel K B K closing of image B by kernel K B open under K: B open w.r.t. K: B= B K B closed under K: B closed w.r.t. K: B= B K DC & CV Lab. CSIE NTU

54 5.2.5 Opening and Closing (cont’)
=lena.bin.128= DC & CV Lab. CSIE NTU

55 5.2.5 Opening and Closing (cont’)
=lena.bin.open= DC & CV Lab. CSIE NTU

56 5.2.5 Opening and Closing (cont’)
morphological opening, closing: no relation to topologically open, closed sets opening characterization theorem A K: selects points covered by some translation of K, entirely contained in A DC & CV Lab. CSIE NTU

57 5.2.5 Opening and Closing (cont’)
opening with disk kernel: smoothes contours, breaks narrow isthmuses opening with disk kernel: eliminates small islands, sharp peaks, capes closing by disk kernel; smoothes contours, fuses narrow breaks, long, thin gulfs closing with disk kernel: eliminates small holes, fill gaps on the contours DC & CV Lab. CSIE NTU

58 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

59 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

60 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

61 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

62 5.2.5 Opening and Closing (cont’)
=lena.bin.128= DC & CV Lab. CSIE NTU

63 5.2.5 Opening and Closing (cont’)
=lena.bin.close= DC & CV Lab. CSIE NTU

64 5.2.5 Opening and Closing (cont’)
unlike erosion and dilation: opening invariant to kernel translation opening antiextensive like erosion and dilation: opening increasing DC & CV Lab. CSIE NTU

65 5.2.5 Opening and Closing (cont’)
A K: those pixels covered by sweeping kernel all over inside of A F: shape with body and handle L: small disk structuring element with radius just larger than handle width extraction of the body and handle by opening and taking the residue DC & CV Lab. CSIE NTU

66 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

67 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

68 joke 無間道之我想補考 DC & CV Lab. CSIE NTU

69 5.2.5 Opening and Closing (cont’)
extraction of trunk and arms with vertical and horizontal kernels DC & CV Lab. CSIE NTU

70 DC & CV Lab. CSIE NTU

71 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

72 5.2.5 Opening and Closing (cont’)
extraction of base trunk horizontal and vertical areas DC & CV Lab. CSIE NTU

73 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

74 5.2.5 Opening and Closing (cont’)
noisy background line segment removal DC & CV Lab. CSIE NTU

75 DC & CV Lab. CSIE NTU

76 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

77 DC & CV Lab. CSIE NTU

78 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

79 5.2.5 Opening and Closing (cont’)
decomposition into parts DC & CV Lab. CSIE NTU

80 5.2.5 Opening and Closing (cont’)
closing: dual of opening like opening: closing invariant to kernel translation closing extensive like dilation, erosion, opening: closing increasing DC & CV Lab. CSIE NTU

81 5.2.5 Opening and Closing (cont’)
opening idempotent closing idempotent if L K not necessarily follows that DC & CV Lab. CSIE NTU

82 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

83 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

84 5.2.5 Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

85 5.2.5 Opening and Closing (cont’)
closing may be used to detect spatial clusters of points DC & CV Lab. CSIE NTU

86 Joke 超Q雙胞胎 DC & CV Lab. CSIE NTU

87 5.2.6 Morphological Shape Feature Extraction
morphological pattern spectrum: shape-size histogram [Maragos 1987] DC & CV Lab. CSIE NTU

88 5.27 Fast Dilations and Erosions
decompose kernels to make dilations and erosions fast DC & CV Lab. CSIE NTU

89 Joke DC & CV Lab. CSIE NTU

90 5.3 Connectivity morphology and connectivity: close relation
DC & CV Lab. CSIE NTU

91 5.3.1 Separation Relation S separation if and only if S symmetric, exclusive, hereditary, extensive DC & CV Lab. CSIE NTU

92 5.3.2 Morphological Noise Cleaning and Connectivity
images perturbed by noise can be morphologically filtered to remove some noise DC & CV Lab. CSIE NTU

93 5.3.3 Openings Holes and Connectivity
opening can create holes in a connected set that is being opened DC & CV Lab. CSIE NTU

94 5.3.4 Conditional Dilation select connected components of image that have nonempty erosion conditional dilation J , defined iteratively J0 = J J are points in the regions we want to select conditional dilation J =Jm where m is the smallest index Jm=Jm-1 DC & CV Lab. CSIE NTU

95 DC & CV Lab. CSIE NTU

96 5.4 Generalized Openings and Closings
generalized opening: any increasing, antiextensive, idempotent operation generalized closing: any increasing. extensive, idempotent operation DC & CV Lab. CSIE NTU

97 Joke DC & CV Lab. CSIE NTU

98 5.5 Gray Scale Morphology binary dilation, erosion, opening, closing naturally extended to gray scale extension: uses min or max operation gray scale dilation: surface of dilation of umbra gray scale dilation: maximum and a set of addition operations gray scale erosion: minimum and a set of subtraction operations DC & CV Lab. CSIE NTU

99 5.5.1Gray Scale Dilation and Erosion
top: top surface of A: denoted by umbra of f: denoted by DC & CV Lab. CSIE NTU

100 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

101 5.5.1Gray Scale Dilation and Erosion (cont’)
gray scale dilation: surface of dilation of umbras dilation of f by k: denoted by DC & CV Lab. CSIE NTU

102 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

103 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

104 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

105 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

106 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

107 DC & CV Lab. CSIE NTU

108 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

109 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

110 Joke DC & CV Lab. CSIE NTU

111 5.5.1Gray Scale Dilation and Erosion (cont’)
gray scale erosion: surface of binary erosions of one umbra by the other umbra DC & CV Lab. CSIE NTU

112 5.5.1Gray Scale Dilation and Erosion (cont’)
=lena.im= DC & CV Lab. CSIE NTU

113 5.5.1Gray Scale Dilation and Erosion (cont’)
=lena.im.dil= DC & CV Lab. CSIE NTU

114 5.5.1Gray Scale Dilation and Erosion (cont’)
Structuring Elements: Value=0 * DC & CV Lab. CSIE NTU

115 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

116 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

117 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

118 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

119 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

120 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

121 5.5.1Gray Scale Dilation and Erosion (cont’)
=lena.im.ero= DC & CV Lab. CSIE NTU

122 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

123 5.5.1Gray Scale Dilation and Erosion (cont’)
DC & CV Lab. CSIE NTU

124 5.5.2 Umbra Homomorphism Theorems
surface and umbra operations: inverses of each other, in a certain sense surface operation: left inverse of umbra operation DC & CV Lab. CSIE NTU

125 5.5.2 Umbra Homomorphism Theorems
Proposition 5.1 Proposition 5.2 Proposition 5.3 DC & CV Lab. CSIE NTU

126 5.5.3 Gray Scale Opening and Closing
gray scale opening of f by kernel k denoted by f k gray scale closing of f by kernel k denoted by f k DC & CV Lab. CSIE NTU

127 5.5.3 Gray Scale Opening and Closing (cont’)
=lena.im.open= DC & CV Lab. CSIE NTU

128 5.5.3 Gray Scale Opening and Closing (cont’)
=lena.im.close= DC & CV Lab. CSIE NTU

129 5.5.3 Gray Scale Opening and Closing (cont’)
duality of gray scale, dilation erosion duality of opening, closing DC & CV Lab. CSIE NTU

130 5.5.3 Gray Scale Opening and Closing (cont’)
DC & CV Lab. CSIE NTU

131 joke DC & CV Lab. CSIE NTU

132 5.6 Openings Closings and Medians
median filter: most common nonlinear noise-smoothing filter median filter: for each pixel, the new value is the median of a window median filter: robust to outlier pixel values leaves, edges sharp median root images: images remain unchanged after median filter DC & CV Lab. CSIE NTU

133 5.7 Bounding Second Derivatives
opening or closing a gray scale image simplifies the image complexity DC & CV Lab. CSIE NTU

134 5.8 Distance Transform and Recursive Morphology
DC & CV Lab. CSIE NTU

135 5.8 Distance Transform and Recursive Morphology (cont’)
Fig 5.39 (b) fire burns from outside but burns only downward and right-ward DC & CV Lab. CSIE NTU

136 5.9 Generalized Distance Transform
DC & CV Lab. CSIE NTU

137 5.10 Medial Axis medial axis transform medial axis with distance function DC & CV Lab. CSIE NTU

138 5.10.1 Medial Axis and Morphological Skeleton
morphological skeleton of a set A by kernel K ,where DC & CV Lab. CSIE NTU

139 5.10.1 Medial Axis and Morphological Skeleton (cont’)
DC & CV Lab. CSIE NTU

140 5.10.1 Medial Axis and Morphological Skeleton (cont’)
DC & CV Lab. CSIE NTU

141 5.10.1 Medial Axis and Morphological Skeleton (cont’)
DC & CV Lab. CSIE NTU

142 5.11 Morphological Sampling Theorem
Before sets are sampled for morphological processing, they must be morphologically simplified by an opening or a closing . Such sampled sets can be reconstructed in two ways: by either a closing or a dilation. DC & CV Lab. CSIE NTU

143 =========== Joke===========
DC & CV Lab. CSIE NTU

144 5.12 Summary morphological operations: shape extraction, noise cleaning, thickening morphological operations: thinning, skeletonizing DC & CV Lab. CSIE NTU

145 Homework Write programs which do binary morphological dilation, erosion, opening, closing, and hit-and-miss transform on a binary image (kernel r=2) (Due Nov. 7) Write programs which do gray scale morphological dilation, erosion, opening, and closing on a gray scale image (Due Nov. 21) DC & CV Lab. CSIE NTU


Download ppt "Computer and Robot Vision I"

Similar presentations


Ads by Google