??x and ??y for sensor S0 can be calculated as:
??x = X 8s2PAs0
Wx(xs, ys)Gx(xs, ys)Vs, (8)
??y = X 8s2PAs0
Wy(xs, ys)Gy(xs, ys)Vs. (9)
By observing equation (6) and (7), we know the basic idea behind the
Prewitt filters is to find the gradient in the x and y axes by deducting the
sum of grey levels of left pixels from the right ones and subtracting the sum
of grey levels of upper pixels from the below ones respectively. To simulate
this behavior, the new pair of ???convolution mask??? can be defined as:
Gx(xs, ys) = ?? 1 if xs ?? x0,
??’1 if xs < x0,
(10)
Gy(xs, ys) = ?? 1 if ys ?? y0,
??’1 if ys < y0.
(11)
Thus, the sum of Gx(xs, ys)Vs and Gy(xs, ys)Vs in equation (8) and (9)
represent the gradient of the values of event predicates for sensor S0 in the x
and y directions.
Fig. 3. The four quadrants around sensor S0, where n1+ = 4, n1??’ = 1, n2+ =
3, n2??’ = 2, n3+ = 1, n3??’ = 4, n4+ = 2, n4??’ = 3.
154
Chapter 6 Boundary Detection for Sensor Networks
Now, let??™s discuss the weighting function G(x, y). To take spatial information
into consideration, we can divide the region around sensor S0 into
four quadrant areas as shown in Figure 3. Let (ni+, ni??’)i=4
i=1 be the number
of sensors with 1 and 0 values of event predicates in each quadrant. A simple
weighting function is as follows:
Wx(x, y) = ( 1
n1++n1??’+n4++n4??’
if x < xs0 ,
1
n2++n2??’+n3++n3??’
if x > xs0 ,
(12)
Wy(x, y) = ( 1
n1++n1??’+n2++n2??’
if y > ys0 ,
1
n3++n3??’+n4++n4??’
if y < ys0 .
Pages:
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270