数字图像处理课件lecture3-2013

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
6
The first (S') and second (S") difference signals are scaled approximations to the first and second derivatives of the signal S
S
f(x)
S=
S[i-1]
S[i]
S[i+1]
S3 = 12 12 12 12 24 12 12 12 12 12
0
i
S’3[i] 12
0
S3 M’= 0 0 0 12 0 -12 0 0 0 0
i
14
-12
S4[i] 24 12
0 15 18 21 24
S4 is an upward ramp
i
M’= -1 0 +1
S’4[i] 12
0
S4 =
S”4[i] 3
0
S4 =
12 12 12 12 15 18 21 24 24 24
S4 M”= 0 0 0 -3 0 0 0 3 0 0
i
-3
18
Some properties of derivative masks
Coordinates of derivative masks have opposite signs in order to obtain a high response in signal regions of high contrast. The sum of coordinates of derivative masks is zero so that a zero response is obtained on constant regions. First derivative masks produce high absolute values at points of high contrast. Second derivative masks produce zero-crossings at points of high contrast.
1
Image Processing for Pattern Recognition
Acquisition
Preprocessing
Scaling Feature Extraction Centering Enhancement Pixel Feature (Histogram) Matching Filtering (Transform) Boundary Classification Tree Classification Binarization (Thresholding) Projection Neural Network Edge detection Moments Post Processing Thinning Transformation
High contrast
High contrast
4
Typically, such points form the border (or edge) between different objects or scene parts.
Border
(a) Neighborhood templates or masks can be used.
S3 = 12 12 12 12 24 12 12 12 12 12
i
S”3[i]
24 12
0
S3 M”= 0 0 0 -12 24 -12 0 0 0 0
i
zero-crossing 17
-12
S4[i] 24 12
0 15 18 21 24
S4 is an upward ramp
i
M”= -1 2 -1
12
0
i
S’3[i] 12
0
S3 M’= 0 0 0 12 -12 0 0 0 0 0
i
10
-12
S4[i] 24 12
0 15 18 21 24
i
S4 is an upward ramp, the first derivative mask M’ can be used to detect the edge (border)
Given that the signal S is a sequence of samples from some function f, then f ( x) f ( xi ) f ( xi 1 ) f ' ( xi ) x xi xi 1 Assuming that the sample f ( x) spacing is x = 1, the f(xi) derivative of f (x) can be approximated by f(xi-1) f ' ( xi ) f ( xi ) f ( xi 1 ) x 0 xi-1 xi
2
3
1. Detecting Edges Using Differencing Marks
Image points of high contrast can be detected by computing intensity differences in local image regions.
12 12 12 12 15 18 21 24 24 24 0
S4 M’= 0 0 0 3 6 6 6 3 0
i
15ห้องสมุดไป่ตู้
Second Derivative Mask M” = [-1, 2, -1]
Use of second derivative mask, signal contrast is detected by a zero-crossing, which localizes and amplifies the change between two successive signal values.
13
S2[i] 24 12
0
S2 is a downward step edge
i
S2 = 24 24 24 24 24 12 12 12 12 12
S’2[i]
0
S2 M’= 0 0 0 0 -12 -12 0 0 0 0
i
S3[i]
-12
24
12
S3 is a bright impulse or line
(b)
We start by using one-dimensional (1D) signals. The 1D signals could just be rows or columns of a 2D image.
5
Differencing 1D Signals
dy d2y Mathematic formula of derivatives : f ( x) , f ' ' ( x) 2 dx dx Masks can be used to represent of the derivatives of a signal.
S [i ] S [i 1] S [i ] mask M [1,1]
S [i ] S [i ] S [i 1] ( S [i ] S [i 1]) ( S [i 1] S [i ]) S [i 1] 2 S [i ] S [i 1] mask M [1,2,1]
M’= -1 0 +1
Because x = 2, it will give a high estimate of the actual derivative unless the result is divided by 2. Moreover, this mask is known to give a response on perfect step edges that is 2 samples wide.
S’4[i] 3
0
S4 =
12 12 12 12 15 18 21 24 24 24 0 0
S4 M’= 0 0 0 3 3 3 3 0
i
11
First Derivative Mask M’ = [-1, 0, 1]
Use of another common first derivative mask, which has 3 coordinates and is centered at signal point S[i], so that it computes the signal difference across the adjacent values.
8
Examples
S1[i] 24 12
0
S1 =
12 12 12 12 12 24 24 24 24 24
i
M’= -1 +1
S1 M’= 0 0 0 0 12 0 0 0 0 0
S’1[i] 12
0
i
S1 is an upward step edge, the first derivative mask M’ can be used to detect the edge (border)
0
S2 is a downward step edge
i
S2 = 24 24 24 24 24 12 12 12 12 12
S”2[i] 12
0
S2 M”= 0 0 0 0 12 -12 0 0 0 0 S3[i]
i
zero-crossing
24
12
0
-12
S3 is a bright impulse or line
S[i+2]
Masks M' and M" represent the derivative operations
M’= -1 +1
S’ =
S[i]-S[i-1]
S[i+1]-S[i]
S’’ =
S[i+1]- 2S[i] + S[i-1]
M’’= +1
-2
+1
7
The first derivative of f(x) can be approximated by applying the mask M'= [-1, 1] to the samples in S can obtain an output signal S'. It's convenient to think of the values of S' as occurring in between the samples of S. A high absolute value of S'[i] indicates where the signal is undergoing rapid change or high contrast. Signal S' itself can be differentiated a second time using mask M’ to produce output S”, which corresponds to the second derivative of the original function f. The approximate second derivative can be computed by applying the mask M" to the original sequence of samples S.
M”= -1 2 -1
S1[i] 24 S1 =
0
12 12 12 12 12 24 24 24 24 24 0 -12 12 0 0 0 0
12
i
S1 M”= 0 0 0
S”1[i]
12
0
i
zero-crossing
Example: S1 is a upward step edge
16
-12
S2[i] 24 12
12
Examples
S1[i] 24 12
0
S1 =
12 12 12 12 12 24 24 24 24 24
i
M’= -1 0
S1 M’= 0 0 0 0 12 12 0 0 0 0
+1
S’1[i] 12
0
i
S1 is an upward step edge, the first derivative mask M’ can be used to detect the edge (border) with 2 samples wide.
9
S2[i] 24 12
0
S2 is a downward step edge, the first derivative mask M’ can be used to detect the edge (border) i
S2 = 24 24 24 24 24 12 12 12 12 12 0
S’2[i]
0
i
S2 M’= 0 0 0 0 -12 0 0 0 0 S3[i] 24
-12
S3 is a bright impulse or line, the first derivative mask M’ can be used to detect the edge (border)
S3 = 12 12 12 12 24 12 12 12 12 12
相关文档
最新文档