• 沒有找到結果。

Chapter 6  Automatic Detection of a Passing-by Car with a Two-camera Omni-

6.3  Detection of Car Position in Real World

6.3.1 Transformation of a car model in real world into an omni-image

After the shapes of the passing-by car in the omni-images are known, we attempt to simulate the car shape in an omni-image in this study. We use a cuboid with a general size of a car model of TOYOTA Inc., whose size has the dimension of (CL, CW, CH) = 482.5cm×182cm×147cm, where the parameters are the length, width, height of the car. To simplify the computation, we use the major three surfaces to construct the car shape in an omni-image. More specifically, the passing-by car is assumed to be seen from two directions: one is lateral in front of the video surveillance car, and the other is parallel aside the video surveillance car. Thus, the three surfaces which are the

Top Right Behind

shown in Figure 6.9.

(a) (b) Figure 6.9 The cuboids we used. (a) A lateral passing-by car. (b) A parallel passing-by

car.

If the position of the passing-by car in the WCS is known, we can use Equations (5.5) through (5.8) of the backward mapping method proposed in Section 5.2.1 to get the corresponding car position in the ICS. An example of a cuboid shape placement in an omni-image using these equations is shown in Figure 6.10.

Figure 6.10 An example of cuboid shape placement in an omni-image using forward mapping.

However, by observing the experimental data, the upper half car body is susceptible to light intensity and its shape is always apparent to detect. On the other hand, the lower half car body is sometimes in the shadow, so its shape with respect to the upper half one is comparatively harder to detect. Accordingly, we use a cuboid (CL,

Top

Right Behind

CW, CH / 2) which simulates the upper half car body. As shown in Figure 6.11(a), the cuboid shape is fragile. We can use erosion and dilation described in Section 6.2.2 to solve this problem and let the template matching described in the next section to work correctly, as shown in Figure 6.11(b).

(a) (b) Figure 6.11 A cuboid shape in an omni-image. (a) Without erosion and dilation. (b)

With erosion and dilation.

6.3.2 Detection of car position by template matching

An approximate position of the passing-by car is needed to know for constructing the corresponding car shape in the omni-image. As shown in Figure 6.12, the centroid (mx, my) of the passing-by car region in the omni-image can be computed by Eq. (6.4), which is marked as the pink point in the figure:

1 ( , ); where p(u, v) is a marked point at coordinates (u, v), pu(u, v) returns its u-axis value,

pv(u, v) returns its v-axis value, n is the total number of p(u, v).

In a general case, we assume that the centroid is a point on the middle horizontal plane of the car body. If the centroid does not belong to the marked car body, we find the first edge point from the midpoint to the center of the omni-image, marked as the blue point in Figure 6.12.

(a) (b) Figure 6.12 An approximate position of the passing-by car. (a) The omni-image taken

by the upper omni-camera. (b) The omni-image taken by the lower one.

The edge point may be regarded an approximate position of the passing-by car we use, and the height of the edge point is assumed to be a half of the height of a general car. Then, we can use Equations (5.1) through (5.4) of the forward image mapping method proposed in Section 5.2.1 to get the corresponding position P(X, Y, Z) of the edge point in the WCS, where Z = CH / 2 and CH is the height of a general car.

According to the resulting image after region growing, shown as the red region in Figure 6.13, if the following equation, Eq. (6.5), is satisfied, the orientation of the passing-by car is decided to be parallel to the video surveillance car; otherwise, it is decided to be lateral:

|MaxJ − minJ| >= |MaxI − minI| (6.5) where MaxI, minI, MaxJ, and minJ are the extreme corner coordinates of the car shape as illustrated in Figure 6.13. By using the position P and the orientation of the passing-by car, we can construct a cuboid shape on the corresponding position. Note that, we also record the center of the passing-by car (cu1, cv1) in the omni-image which is mapped from the center of the cuboid model.

Figure 6.13 Decision of the passing-by car orientation.

After obtaining the cuboid shape in the omni-image, we superimpose the cuboid shape on the passing-by car shape in the image and perform an AND operation. More specifically, the cuboid shape shifts within a region R of 100×100 pixels located at relative coordinates from (−50, −50) to (50, 50), and the number of the overlapping pixels between the cuboid shape and the passing-by car shape is counted. Then, the two shapes are decided to match at a spot where this number of overlapping is the maximum with a shift (Su, Sv) with respect to the origin of the region R. After this way of template matching, we can obtain the center of the passing-by car by the following equation:

1 1 u; 1 1 v.

cu =cu +S cv =cv +S (6.6) And this position becomes more accurate in general. An example of the two shape

minJ

minI MaxI

MaxJ

matching is shown in Figure 6.14.

The two cameras in a two-camera omni-directional imaging device perform the same process and the two corresponding centers of the passing-by car can be obtained.

Then, we can derive the position of the passing-by car in the WCS using the method described in Section 4.3.3.

Figure 6.14 An illustration of template matching.