Adaptive Zoom Distance Measuring System of Camera Based on the Ranging of Binocular Vision

Binocular vision ranging, according to the principle of parallax, represents the three dimensional depth in a parallax of 2d image plane. In order to improve the measurement accuracy of the binocular vision ranging, an adaptive zoom distance measuring methodology is focused on in the work. The causes of the error generation during the ranging process and its improvement difficulties are discussed. SIFT (Scale-invariant feature transform) is introduced to obtain parallax. With the samples of focal length acquired through the distance formula, the focal length function about distance is fitted through the least square method. A new distance formula is derived from the focal length function and the distance formula. In addition, a corresponding system is developed to realize the ranging process. To illustrate the procedure of the combination approach, an experiment is conducted with the developed system. The data from the experiment show that this technique can achieve accurate ranging. With the adaptive zoom method, ranging accuracy can reach more than 90%.


Introduction
With higher measurement accuracy and better real-time, Binocular vision ranging technology (El-Hakim S. F., Pizzi N. J., & Westmore D. B., 1992) has been well received by the people's attention.Binocular vision ranging is modeled on the human eyes to obtain distance (Gao W. & Chen X. L., 1998), it uses two cameras on the same scene from different positions for imaging, and matches the two different camera views of 3D point through a variety of stereo matching algorithm, then calculates the parallax (Wu R. X., 1994) in order to obtain three-dimensional scene depth information.
Image matching, the corresponding relation of the same scene under different viewpoints, is not only the important technology in the field of computer vision, but also is the cornerstone of computer vision applications (Kong X. D., Qu L., & Gui G. F., 2004), such as: the depth of recovery, camera calibration, motion analysis and 3D reconstruction.Some matching algorithms based on gray scale, are too computationally intensive.Also some algorithms, which are based on the size, the ratio or the phase, have common problems: 1) the focal lengths of left and right camera cannot change, 2) scale cannot zoom in and out, 3) rotation angle cannot be too big, 4) the deformation cannot be too obvious (Jia S. J., Wang P. X., & Jiang H. Y., 2010).With the development of digital image technology and computer technology, image matching technique based on feature appears.Owing to the support features extracted from features (points, lines, surfaces, and other features) of two or more images, the parameters are obtained through the description of the features.In addition, feature matching is matched according to the parameters described.Among these image matching algorithms, the SIFT (Scale-invariant feature the transform) algorithm is representative, which was raised by Lowe D. G. (2004).
Binocular vision ranging is based on the triangulation system.In this system, there are many factors affecting the measurement accuracy, which are reflected in the following areas: 1) low resolution of the camera affects picture quality; 2) focal length and optical center distance (distance between the camera) are not fixed in the measurement process, which has a direct impact on ranging accuracy; 3) the optical axes of left and right camera are not parallel in the measurement process, which affect two pictures matching (Xu J., Chen Y. M., & Shi Z. L., 2009).Through the discussion of ranging effects in the case of different focal lengths, it is significant to take zoom distance measuring method to improve the accuracy of ranging.
Zoom ranging is an effective measure to improve ranging accuracy.After we study measurement of error and analysis of binocular ranging system, we give a zoom-ranging method based on SIFT image feature matching in order to improve ranging accuracy.This method is the application of the SIFT matching algorithm, which is fast, matching accurately, and has better robustness for image scale, changes in focal length and perspective, and noise.The application of the least squares method plays an important role in promoting the zoom ranging system.As a computational tool to fit the focal length formula, the least squares method has better estimation performance.According to the formulation, binocular ranging system changes the three dimensional space depth into 2d image plane for the parallax.

Binocular Vision Ranging System
SIFT (Scale-invariant feature the transform) is a computer vision algorithm used to detect and describe the locality characteristics of the image.In addition, SIFT can find the extreme points in the spatial scale and extract its location, scale, rotation invariant, which was published by David G Lowe in 1999 and summarized in 2004.
The SIFT algorithm is to use Gaussian function in different scales for the image smoothing, then compare the difference between the smoothed images to find obvious feature point whose pixel very different from others.
The algorithm mainly includes the following five steps (Lowe D. G., 1999;2004): 1) Build the scale space to detect the extreme point, and obtain scale invariance.
2) Filter feature point, locate precisely, exclude unstable feature points.
3) Extract the description of the character among the feature points and assign the value in the direction to the feature points.
4) Generate a feature descriptor to find a match point by the use of characteristic descriptors.
5) Calculate the transformation parameters.
The above discussed triangulation system requires the optical axis to be strictly parallel, and the focal length to be fixed, but with the actual distance larger, the measured focal length is larger during the ranging test.Once the camera focal length changes, you need to re-calibrate the camera, otherwise, the depth error in the measurement is big (Carsten S., U-rich M., & Wiedemann C., 2007).

Adaptive Zoom Distance Measuring System
In order to solve error and improve ranging accuracy in the actual ranging process, with the above-mentioned ranging system, we propose a new ranging method.It can make a corresponding change in focal length, when the actual distance changes.

How to Fit Focal Length Function and Get New Depth Formula
This method is to use the depth formula to find focal length value, according to actual distance of the target and aberrations (Where the aberration is the above-mentioned parallax).In addition, aberrations can be acquired in ranging process.Table 1 is a set of data a set of data obtained with the traditional ranging method.From Table 1, the actual distance is from 500 to 1500 mm, aberration is obtained through image matching during the ranging process, and focal length is acquired with the above-mentioned formula for depth.After repeated experiments and calculation (by MatLab), optimized value are: T--distance between the cameras, a fixed value.
A new depth formula can be obtained from the above-mentioned depth formula and the focal length formula, and the following equations are composed as: A new depth formula is expressed as: From Figure 2, We can see the two curves, one is the curve of focal length on the actual distance, the other is the curve of focal length on the actual distance fitted through the least squares method.

Establishment of Adaptive Zoom Distance Measuring System
It can be seen from this new depth formula, no correlation between the depth and the focal length, in other words, the changes in focal length do not affect the measurement of the actual distance.With the new depth formula and SIFT matching algorithm, an adaptive zoom ranging strategy is constructed and a corresponding system is developed to realize the online ranging process.

Experiments
In order to verify the above proposed adaptive zoom ranging method, a zoom ranging test program is established.
The test uses Logitech c300 webcam for image acquisition, collects pictures to the ranging system, then applies the SIFT algorithm for image matching.VC2008 and OpenCV2.1 are applied to build binocular zoom ranging system for the range test, the samples are collected, matlab is used for least-squares fitting and evaluation.
The test applies the new depth formula to measure the target distance from actual distance of 550~1550 mm.

Conclusion
The application of SIFT image matching algorithm achieves matching quickly and accurately, low interference and other good results.Error evaluation of least squares method based on Binocular vision adaptive zoom ranging method, accurately evaluates the binocular measurement error.The establishment of adaptive zoom ranging program can accurately identify the trend of the error, and can effectively improve the measurement accuracy through the test.
In the ranging process, when the actual distance is smaller than a certain value, the measurement accuracy is very low.High camera resolution, the improvement for measurement accuracy of image size and the accuracy of linear fitting can improve the ranging accuracy.Improve ranging accuracy, the corresponding algorithm is a difficult, further research is needed.
Compared with other ranging methods, this method is low-cost and suitable for the visual ranging system of mobile robots, space satellite tracking systems, automated aircraft landing and precision navigation systems, battlefield reconnaissance system.
Binocular vision ranging is based on the triangulation system (Gary B. & Adrian K., 2009).From Figure 1, we can see: P is the target point; O1 and O2 are the optical center of two cameras; P1 and P2 are the imaging point of the target point P on the left and right images, the corresponding abscissa are x1 and x2 respectively.

Figure 2 .
Figure 2. Fitting curve of focal length

Figure 3 .
Figure 3. Curves of actual distance and measured distance Description: Figure3shows the contrast between the actual distance and the measured distance.With the samples of the measured distance and the actual distance, the error evaluation between them can be acquired through the least square method and the results show in Figure4.From Figure4, we can see that the largest positive deviation is 6 mm, the same as the largest negative deviation.Through analyzing, we can find the deviations of the measured distance fluctuate in the -6 ~6 mm.

Figure 4 .
Figure 4.The error curve of measured distance

Table 1 .
The data of distance, aberrations and focal length