• 沒有找到結果。

Correcting Global Coordinates of Vehicle Automatically

Chapter 4 Construction of Environmental Maps and Patrolling in Learned

4.4 Patrolling in Indoor Environment

4.4.1 Correcting Global Coordinates of Vehicle Automatically

Because an autonomous vehicle suffers from mechanical errors, the correction of the position is needed. Furthermore, the error of the direction of a vehicle will be

accumulated. In this study, we propose four correction strategies to correct the position and direction of a vehicle. The four strategies are:

1. position correction;

2. direction correction;

3. enforced direction correction;

4. ending path segment correction.

A. Vehicle location correction strategy 1 --- position correction

When a vehicle navigates to a turning point, it should correct its global coordinates. Because a turning point is a destination of a path segment, in order to avoid the accumulation of mechanical errors in this path segment, the position of the vehicle must be corrected at the turning point. In this study, images taken by the fisheye camera are used to calculate the exact position of a vehicle. First, when a vehicle navigates to a turning point, we can get the odometer values of the vehicle, which include the x-coordinate and the y-coordinate of the vehicle, and the direction angle of the vehicle. In this strategy, the x- and y- coordinates will be corrected. After getting the values of the odometer, we can know the approximate position of the vehicle. Then we judge which camera should be used to get an image of the vehicle and calculate the center point of the vehicle shape in the image. When the center point is calculated, because the approximate position of the vehicle is known, only a partial image neighboring to the vehicle position need be processed. The steps are shown in Figure 4.6.

The method we propose to calculate the position of the vehicle is described in the following. Because the odometer values are expressed as global coordinates, the values of the position in the odometer should be converted into image coordinates

Cimg using the corresponding mapping table. Then the partial image of the square region whose center is located at Cimg is subtracted from the background image. The size of the square region is changeable and is small at the beginning. The background image is an image which is taken by the same camera in advance, so there is no dynamic obstacle in there. After the subtraction of two partial images, the pixels which have big differences between the foreground and background will be found out.

Afterward, the erosion and dilation operations mentioned previously are applied to eliminate the noise and smooth the edges in the image. Then, a connected component in the image is segmented out, and the average of all the coordinates in the component is computed to be the new coordinates Cimg of the vehicle shape center.

Figure 4.6 Steps of correcting the position of vehicle.

If the region of the whole vehicle is not found out, then the steps mentioned above will be done again with the new Cimg and a square–regioned tracking window with a bigger size. After the region of the whole vehicle is found, the exact center point of the vehicle is the newest Cimg. The size of the square region will become bigger and bigger when every iteration of the steps is done, and every Cimg will become closer and closer to the real center point of the vehicle.

We use a tracking window with a changeable size to find the centroid of the

size include:

• avoiding the influence of other dynamic obstacles or people;

• increasing the precision of the vehicle region detection;

• speeding up computation.

Because we use fisheye cameras in this study, the size of a vehicle in images will change when the vehicle navigates to a different position. If the size of square region is changeable, the area which has to be processed will be much smaller than using a square area with a fixed size. When the processed region is smaller, the probability of interfering by dynamic obstacles will decrease. The processed region with a square mask with a fixed size and a mask with a changeable size are shown in Figure 4.7.

The yellow point is the real central point of a vehicle, and the purple point is the position recorded in the odometer with mechanic errors. The total region with a changeable mask is smaller than the region with a mask with a fixed size.

The process of calculating the exact position of a vehicle is described in Algorithm 4.3, and a real example of finding the central point of a vehicle is shown in Figure 4.8.

(a) (b)

Figure 4.7 The calculating region. (a) with a fixed square mask. (b) with a changeable

(a) (b)

(c)

Figure 4.8 Finding the central point of a vehicle. (a) the background image of an environment. (b) The foreground image with a vehicle. (c) The found central point of a vehicle.

Algorithm 4.3: Calculating the exact position of a vehicle.

Input: An image taken by a fisheye camera, and the coordinates of the vehicle position recorded in the odometer.

Output: The exact position of the vehicle.

Steps:

Step 1. Convert the coordinates in the odometer to the ICS and obtain the image coordinates Cimg.

Step 2. Subtract the partial image in the square region whose center is located at Cimg from the background image to find the pixels which have big difference values.

Step 3. Apply the erosion and dilation operations to the image of the region.

Step 4. Find the connected component in the image.

Step 5. Calculate the average of all the coordinates in the component and obtain new Cimg.

Step 6. If the region of the whole vehicle is found out, then go to Step 3; otherwise go to Step 2 with the new Cimg and a square region with a bigger size.

Step 7. Convert the new Cimg to the GCS by the method mentioned in Chapter 3 using the mapping table.

B. Vehicle location correction strategy 2 --- direction correction

Mechanical errors not only cause inaccuracy in vehicle positions, but also inaccuracy in vehicle directions. The technique of this strategy is to correct the direction errors. Because the exact positions of a vehicle are calculated at every turning point in Strategy 1, we can use two consecutive positions to calculate the vector of the direction, as shown in Figure 4.9.

O B

A

1

2

But when the path between two consecutive turning points is too long, the mechanical errors will be large. Take OA in Figure 4.9 as an example. The angle calculated by use of the line through points O and A is 2, but the exact angle should be 1. So if we want to limit the error of the vehicle direction within a certain degrees, say , a limit of the length of the path between two turning points can be calculated by the following method. The approximating function of direction errors of a vehicle can be obtained by experiments. The function of the error of the vehicle which we use in this study is (Tsai and Tsai [17]):

( ) 0.00000476 2 0.00592048 4.16437951

f x

x

x

 . (4.2)

where x is the length of the patrolling path of the vehicle, and f(x) is the error function of the direction in degrees. By the following formula of the solution to a quadratic

we can obtain the positive solution as

00000952

But when the length of a path is too short, another problem will happen. Because

there are some errors when we calculate the center of a vehicle in an image, when the

Figure 4.10 False direction caused by the error of finding center.

If we want to limit the error of the vehicle direction to be within α degrees, and the maximum error of finding the center of a vehicle in an image to be p cm, then we can obtain another limit of the length of the path by the following equations:

2 )

xtan(90)2p. (4.11) For an example, if we want to limit the error of the vehicle direction to be within 5 degrees, and the error of finding the center of the vehicle in an image to be 3 cm, then the correction of the direction is done when the length of a path is limited to be larger than

By Equations 4.4 and 4.11 derived above, if the length of a path is between the two values Vmax and Vmin calculated by these two equations, then the correction of the vehicle direction will be done.

C. Vehicle location correction strategy 3 --- enforced direction correction

Although in Strategy 2 the direction of the vehicle has been corrected, if the length of a path is not between Vmax and Vmin, then the correction of the direction cannot be done. So we set a threshold M, and if the accumulation of the length of the vehicle movement exceeds M and the length L of the next path is not between Vmax

and Vmin, then the vehicle will be enforced to do the correction of its direction by the following method.

First, the next path is divided into two segments. The length of the first segment is set to be (Vmax  Vmin )/2, and the length of the second segment is taken to be L  (Vmax  Vmin )/2, as shown in Figure 4.11. When the vehicle navigates from point a to b, the correction of the vehicle direction will be done by the method mentioned in Strategy 2, because the length of this segment is between Vmax and Vmin.

( V

max

+ V

min

) 2