5.1 Physical anti-Collision based on Particle Swarm Optimization (PSO)
163
d i = L − r i
(5.5)
Afterwards, the distance that the horizontal camera can exactly focus on the i th
RFID tag should be calculated
l i =
f l
l − f
(5.6)
Where l
is the distance between the lens and CCD sensor inside horizontal camera,
f is the focal length of the horizontal camera.
Finally, the distance needed to be adjusted for the horizontal camera is as follows:
L i = d i − l i
(5.7)
If L i is larger than zero, the horizontal camera approaches the tag. Otherwise,
the horizontal camera moves away from the tag.
Canny edge detection algorithm is used to detect the edge of the RFID tag and its
frame [23–25]. First, the Gauss filter is used to get a smooth image
G(x, y) = f (x, y) ∗ H (x, y)
H (x, y) =
1
2πσ 2 exp
−
x
2 +y
2
2σ 2
(5.8)
where (x, y) is the coordinates of the pixels in the image, * represents the convolution,
σ is the scale parameter, which determines the degree of smoothing of the filtering
window on the image, f (x, y) is the input image.
Then, the gradient and its direction of the pixel are calculated by the finite difference
of the first-order derivative
G(x, y) =
G
2
h (x, y) + G 2
v (x, y)
θ(x, y) = arctan
G h (x,y)
G v (x,y)
(5.9)
where G h (x, y) and G v (x, y) are the partial derivative in the parallel direction and
the vertical of the pixel (x, y) respectively. The formulas are as follows:
G h (x, y) =
[I (x,y+1)−I (x,y)+I (x+1,y+1)−I (x+1,y)]
2
G v (x, y) =
[I (x,y)−I (x+1,y)+I (x,y+1)−I (x+1,y+1)]
2
(5.10)
where I (x, y) is the gray value of the pixel.
The non-maximal value of the gradient magnitude G(x, y) is suppressed, and all
the pixels of the gradient magnitude G(x, y) are linearly interpolated. At each pixel
point, the gradient amplitude of center pixel of the neighborhood is compared with
the linear interpolation result. If the gradient amplitude of the neighborhood center
point is larger than the linear interpolation result, the pixel point is the edge point.
Précédent

- 174/247

Suivant