Nearest Neighbour Corner Points Matching Detection Algorithm

Accurate detection towards the corners plays an important part in camera calibration. To deal with the instability and inaccuracies of present corner detection algorithm, the nearest neighbour corners matching detection algorithms was brought forward. First, it dilates the binary image of the photographed pictures, searches and reserves quadrilateral outline of the image. Second, the blocks which accord with chess-board-corners are classified into a class. If too many blocks in class, it will be deleted; if not, it will be added, and then let the midpoint of the two vertex coordinates be the rough position of corner. At last, it precisely locates the position of the corners. The Experimental results have shown that the algorithm has obvious advantages on accuracy and validity in corner detection, and it can give security for camera calibration in traffic accident measurement.


INTRODUCTION
When the traffic policemen deal with traffic accidents, many parameters of the traffic accident are measured with the help of tape. It is likely to cause missed measure, false measure, measure error, and tedious process of measure. For all these reasons, the process of handling the traffic accidents is slow. Some researches of scientific institutions at home or abroad have been developed measuring devices which were based on photogrammetry and machine vision technology [1,2]. But they are difficult to popularize widely as these devices are complex and require professionals to operate. To solve these problems, this paper improved a portable intelligent traffic measurement system, which is simple, accurate, and easy to carry.
We must calibrate the camera [3,4] before using the measurement system because the accuracy of the camera calibration will affect the measurement system accuracy, and the ability to detect the corner point accurately in the image will affect the accuracy of the calibration directly. There are two commonly-used corner detection algorithms: one is the Harris corner detection algorithm [5] and its improved method [6] as the representative is the gray-based assays; the other one is the SUSAN corner detection algorithm [7] and its improved algorithm [8] as the representative is encouraged. The accuracy of Harris corner point detection algorithm is limited, and the SUSAN algorithm is possible to confuse the edge points and corner points. In the camera calibration, for the simple production process of chessboard calibration object, this paper proposes the neighbour matching corner detec-tion algorithm which can identify the chessboard corners. This algorithm can do the dilation operation based on the chessboard image binarization processing (for the block pixel value, 0 is the dilation operation, and 1 is the erosion operation, this paper takes the dilation as an example), make the checkerboard separated, extract image outlines, and then make polygon fitting to the extracted outlines, and reserve the outlines information. It finely classified the quadrilateral outlines, and it is in accordance with the checkerboard layout, determined the location of the corner points. This algorithm has many advantages such as the strong resistance to interference and the corner detection accuracy and stability, and it can also provide a reliable guarantee for camera calibration and measurement.
In this paper' structure, the main contents of the second part are used to discuss the system, the third part describes the nearest neighbour corner matching detection algorithm, the fourth part is the experimental test, the fifth part is the experimental results and error analysis, and the sixth part is the conclusion.

PRELIMINARIES
The basic work flow of the portable traffic accident measurement system is mentioned in this paper as shown in Figure 1. Firstly input more than one image with chessboard calibration object to calibrate the camera, it can measure the scene of the accident after the calibration has been completed. ABSTRACT: Accurate detection towards the corners plays an important part in camera calibration. To deal with the instability and inaccuracies of present corner detection algorithm, the nearest neighbour corners matching detection algorithms was brought forward. First, it dilates the binary image of the photographed pictures, searches and reserves quadrilateral outline of the image. Second, the blocks which accord with chess-board-corners are classified into a class. If too many blocks in class, it will be deleted; if not, it will be added, and then let the midpoint of the two vertex coordinates be the rough position of corner. At last, it precisely locates the position of the corners. The Experimental results have shown that the algorithm has obvious advantages on accuracy and validity in corner detection, and it can give security for camera calibration in traffic accident measurement. This is an Open Access article distributed under the terms of the Creative Commons Attribution License 4.0, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

5
physical parameters of the camera lens, so the camera calibration for once is enough. When taking the pictures of the accident scene, we need to put the chessboard calibration object there. After getting the pictures, we use the capacitance pen to select target point, and then the system will automatically reconstruct the space point [9]. Finally, we measure the distance, angle, area and the turning radius of the traffic accident scene.
In the camera calibration, detection of the chessboard corner in the image is the first thing, and then we calculate the intrinsic matrix. Because the existing corner detection algorithm is defective in accuracy, this paper mainly carries on research in detecting chessboard corner, and presents the neighbour matching corner detection algorithm.  Figure 2. Figure 2 is the process of photographing and transmitting picture in the traffic accident scene. The picture will be influenced by the sensor noise and grain noise. At the same time, due to different exposure and jitter when taking the pictures, it cannot make the image look good. Therefore, the first thing is to denoise and deblur before measurements [11] [10].
Then convert the color image to gray image as shown in Figure 3. The histogram equalization processing uses the adaptive threshold method or hard threshold method towards binaryzation, the binary image is shown in Figure 4: After dilating the binary image, we have obtained [12]. After dilation, the chessboard corners which originally connected together are separated. To search the chessboard corner based on this, the searching algorithm is described as shown in Table 1: Table 1  The first step of searching the chessboard corner location algorithm is drawing a white square in the outline of the binary image which was dilated in order to make the graphics which pass the image boundary and form box as well. The second step is to extract the block outline [13][14], and eliminate the interference outlines. First, extract the image outline including other items' outline at the accident scene, and the outlines are irregular, so we need to make polygon fitting to the outlines [15]. After fitting, the outlines include all kinds of polygons, so it is necessary to exclude the interference of non-quadrilateral outlines. According to the geometrical characteristics of quadrilateral: the number of vertices is 4, the longest length and any other side length are no more than 4 times the length of that, the product of two diagonals is 1.5 times smaller than area, the length of diagonal is 0.15 times greater than the perimeter. And we detect all extracted outline, eliminate the non-quadrilateral and the serious deformation of block, save the information of more upright quadrilateral. The third step is to find the neighbour blocks, calculate the common points which have not been dilated, search the nearest blocks vertex, and be recorded as a public point before dilation. The fourth step is to classify the blocks. If the ICETA 2015 01035-p.3 block in class has four neighbour blocks, then we number and sort them. The fifth step is that when sorting has been completed, then we count the number of blocks; if there are too much blocks, then we remove the blocks which are far offset and add a few more if there are too less. After adding or removing, if it accords with the chessboard, then we determine the rough position of corners point. The sixth step is the accurate calculation of corner position through obtaining the accurate location of the corners. If all the chessboard corners were found, we record them and stop testing. However, if we did not find all the corners, then we continue to dilate and research chessboard corners. If after many dilations and searches, it still cannot find all the corners, then we stop searching and conclude that the chessboard corner detection is failed. Figure 5 shows that if it is not successful to find all the cornersafter many dilations and searches, then we stop searching the binary image which have been dilated many times is shown in Figure 5, and the outline extraction is shown in Figure 6. Several tests have shown that 5~7 times dilation can have a better degree of accuracy.

EXPERIMENTAL TEST
In this experiment using general 5 million pixel video, the calibration object is 5 * 7 chessboard corner and the number of corner points is 35. In order to verify the accuracy, stability and advantage that guarantee the precision of the measurement target, this experiment has two tests, namely the comparative test between Harris corner detection and corner detection algorithm of nearest neighbour and the measuring target test of traffic accident scene.

Comparative test between Harris corner detection and corner detection algorithm of nearest neighbour
In order to verify the two corner detection algorithm, we use two algorithms to test it through using the Harris corner detection algorithm and the nearest neighbour matching corner detection algorithm for chessboard pictures of the same scene. In order to validate the universality of the algorithm, the camera calibration needs many chessboard pictures from different angles. It is necessary to detect 9 chessboard pictures from different angles in this test. And we record the number of corners which have been respectively detected by two kinds of algorithms and respectively marked the corners position.

Traffic accident scene measurement experiment
After the camera calibration, we measure the traffic accident scene with the system to verify the accuracy of the measure object. This system can be used to measure distance, angle, turning radius and area.
During experiment, we put the calibration object in traffic accident scene and take a picture of it, and then we measure the parameters by using the system. At the same time, we use tape to measure the corresponding target, contrast results using two kinds of measurement methods, and verify the measured accuracy of the system. After taking pictures with chessboard, respectively detect by using Harris corner detection algorithm and nearest neighbour corner matching detection algorithm.
The number of the corner points detected is 74 while the nearest neighbour corners matching detection algorithm is 35. The label graph by the two corner detection algorithms is shown in Figure 7.
We can test the 9 images through using the Harris corner detection method and the nearest neighbour matching detection algorithm. Recall ratio and precision are also needed to measure the accuracy of the corner points detection. Recall and precision are used to measure the performance of search engine, and also applied to information extraction field. Recall = the correct information numbers have been extracted / the information numbers in sample. Precision = the correct information numbers have extracted / the information numbers have been extracted.
In this application, the correct information numbers which have been extracted are the correct corner points numbers which have been detected, the correct information numbers which have been extracted refer to all corner points numbers the algorithm has detected. The information numbers in sample refers to the chessboard corner points. In this system, the number of chessboard corner points is 35. The higher recall ratio and precision are, the more accurate corners detection is. Calculate the recall ratio and precision of each image, the broken line char is shown in Figure 8:  The average recall ratio of the Harris corner detection method is 0.8698, and the average precision is 0.424, while the average recall ratio of the nearest neighbour corner point matching detection algorithm is 0.9936, and the average precision is 1. From the average recall ratio and precision, the algorithm pre-ICETA 2015 01035-p.5 sented in this paper has great advantages in precision and recall ratio, and it can detect the chessboard corner images taken from different angles, and it has higher stability and accuracy.
In the second part of test, we measure the accident scene by using this system, the measured data and the true value of error analysis are shown in Table 2: We can get something from the table that the error between the measured results of this system and the actual measurement is relatively narrow. The nearest neighbour corner point matching detection algorithm can provide a guarantee for the precision and stability of the system measurement.

SUMMARY
In this paper, combined with the dilation operation, image outline extraction and polygon fitting and classification method, a nearest neighbour corner point matching detection algorithm method was presented for the chessboard corner detection. The experimental results show that, this algorithm is better than the classical Harris corner detection algorithm with high precision, and the detection is stable, it can provide the reliable guarantee for camera calibration. After using this algorithm in camera calibration as it is measured in traffic accident scene, we can found that the error is relatively small and the accuracy is relatively high.