Auto Image Calibration for Vehicle Speed Measurement Using Single Camera

This research propose new method of auto image calibration for vehicle speed measurement using single camera. Image processing is used to discriminate vehicle and measure vehicle speed. However, in order to measure something by image processing, we must do camera calibration. Therefore, we developed auto image calibration to measure vehicle speed. This method need only single camera. This method use projective transformation with homography matrix. For obtaining homography matrix, more than four congruent points are necessary. We developed the algorithm which can calculate eight congruent points from the broken lines of road in image. If we use this new method, we can measure vehicle speed without manual process of camera calibration.


Introduction
Recently, we use image processing for measuring field.We can measure many thing with several camera and image processing.For example, image processing can measure a length of something like boxes, line and building.Other thing is speed of something like thrown ball.Among them, now, we are aiming to measure a vehicle speed by image processing.Generally, for measuring the vehicle speed, radar or loop coil method are used.However, some machine using these method are very expensive.Therefore, new method which can measure the vehicle speed by image processing and a cheap camera is developing.This method can calculate the vehicle speed from only an image of running vehicle.
In order to perform these measurements, we have to solve one thing.It is calibration of camera.When we measure the vehicle speed from the image, calibration is necessary to calculate a real distance of a road in the image.Generally, for calibration, we use two cameras.However, if we use two cameras, cost become high.Therefore, my purpose is to develop an auto image calibration method using single camera.This method perform projective transformation.Projective transformation needs homography matrix.In order to obtain homography, more than four congruent points are necessary.Therefore, in this research, we developed a new system which extract eight congruent points from the image automatically.By this system, when we take the running vehicle, calibration can be done automatically.In this paper, we show the method of auto calibration and simulation with some images.

Method
In order to extract eight congruent points, we extract some broken white lines from a road image.All broken white lines are same length and we know this length.In highway, length of broken white line is 7[m] and in local roads, it is 5[m].If we can obtain the coordinate of some broken white lines in the image, distance between each coordinate are same.By these obtained coordinate, this method calculates eight congruent points for calculating of homography matrix.

Extracting of broken lines
For extracting some broken white lines of road, we use template matching.However accuracy of template matching is not good.Therefore we also use labeling processing.Both methods are often used in image processing filed.By both process, we choose candidate coordinate of the broken white lines from the image.Following process is the method which extract them.Road image using in this explanation is Fig. 1.
(a) Binarization First processing is binarization.Some white lines and broken white lines is extracted, but other area are also extracted.
(b) Template Matching processing Before matching processing, thinning processing is necessary.A width of each location in image is difference.This matching is for finding the point of line.This template matching processing finds some locations where match to a template image.A result of template matching may include other location because accuracy of template matching is not very good.
(c) Labeling processing In order to make accuracy better, we performed labeling processing against Fig. 1.After labeling processing, this processing chooses some location judged to be a line.Following conditionals are to judge to be a line.
The mean of each variable are showed in Fig. 1.   is a pixel number of each labeling area.First step is to exclude some labeling area where pixel number is less than 30.Second step is to exclude some labeling area where length of a width is longer than length of a height.Third step is to choose some location where a barycenter is a center of the labeling area.Because if the labeling area is shape of line, the barycenter is near the center of the labeling area.
(d) Extracting of Broken line processing First processing compares the result of template matching and the result of labeling processing.Next processing chooses same location of both extraction result.These chosen locations are decided to some broken line of road.These locations chose from Fig. 1 as broken white line are show red line in Fig. 2.
(e) Extracting of Broken line By the result of prior processing, this processing can estimate an area including all broken white lines in the road image.In Fig. 2, (𝑥1, 𝑦1) is a coordinate of first extracted location and (2, 2) is the coordinate of second extracted location as the broken white line.From these coordinates, we calculate (, ) in Fig. 2.An area of  in Fig. 8 including (, ) is considered that include all broken line of road.Therefore, we calculate  by (, ) and perform mask processing to the area of  in Fig. 2.  and (, ) are as following equations.

𝑓(𝑥, 𝑦
Where  2 and  1 are show in Fig. 1 and  − ℎℎ is number of image height pixel.
Finally, we perform binarization and labeling processing in the area of  to extract all broken white line from the image.

Calculate the Parameter of Homography
We calculate eight congruent points with the extracted (, ) coordinates to obtain homography matrix.These points can be used to the parameter of homography.Following process is a method which calculate eight congruent points.
(a) Calculate an inclination of the broken line Following equations are for calculating the inclination.
Each variable are show in Fig. 3. Eq. ( 3) is showed  1 (, ) in Fig. 3.For obtaining eight points, we perform this processing against four broken lines.
(b) Calculate a line which crosses at right angle Next step is to calculate the line which crosses Eq. ( 3) at right angle through ( 1 ,  1 ).Eq. ( 6) is for calculating the line.This line is showed  2 (, ) in Fig. 3.We also perform this processing against four broken lines.
(c) Calculate the parameter of the homography Finale step is to find the points which  2 (, ) in Fig. 3 cross the white line of road.These points are showed P 1 ~8 in Fig. 3.These points are used to the parameter of the homography.

Projective Transformation
Projective transformation uses homography matrix calculated by 1 ~8 .A following matrix  is homography matrix.
The homography matrix  contains eight variables.In order to calculate these eight variables, we need more than four variables of congruent point.Therefore, these congruent points are  1 ~8 .Projective transformation changes to image of Fig. 4 from image of Fig. 3 by matrix .Some congruent points of  1 ~8 are show  1 ~8 in Fig. 4.

Simulation
We did simulation of the above processes against Fig. 5. First, we show some result of extracting some broken line of road.The binarization and thinning result is Fig. 6.The template image for matching processing is Fig. 7 and the result image is Fig. 8.The image of extracting some broken white lines is Fig. 9.
Next, the image result of extracting all broken line area is Fig. 10.And Fig. 11 is the image which is drawn the black lines at location decided to homography parameter.

Conclusions
We developed the new method of auto calibration.This new method can obtain homography parameter automatically and do projective transformation.If we use this method, we can measure the vehicle speed automatically.When we take the photo of running vehicle and measure the migration distance of a second in image, we can calculate the real migration distance of a second with this new method.However, states of the broken line of road are different in each road.In the future, we have to reach some state of road and develop the auto calibration method for all states of road.Finally, we would like to make the auto vehicle speed measurement system with single camera.

Fig. 1
Fig. 2 Extraction of all broken lines are

Fig. 10
Fig. 10 Extraction of broken lines area.

Fig. 12
Fig. 12 Some broken lines of road