# Robot Obstacle Recognition and Target Tracking Based on Binocular Vision

Authors: Wencheng Sun
Journal: Advances in Multimedia
 (2022)

---

## Abstract

To further improve the perception ability of binocular vision sensor in getting rich environment information and scene depth information, a research method of a robot obstacle recognition and target tracking based on binocular vision was proposed. The method focused on target recognition and obstacle recognition of binocular stereo vision. The system based on obstacles of visual identification was set up. Through the analysis of the Bouguet mathematical model algorithm based on OpenCV, the binocular stereo correction was carried out and the obstacle recognition system was calibrated and corrected. Through the experimental data, it was found that the average error of the obstacle recognition and target tracking algorithm based on binocular vision could be controlled within 50 mm within the range of 2100 mm. The average time of obstacle recognition was 0.096 s and the average time consumption of the whole system was 0.466 s, indicating that the robot obstacle recognition and target tracking system based on binocular vision could meet the accuracy and real-timeness requirements of obstacle recognition and detection.


---

## Body

## 1. Introduction

With the development of science and technology and changes in social development needs, mobile intelligent technology has been widely used in industries such as industry, medical care, agriculture, and breeding. The emergence of the mobile robot technology makes the program preset in advance work automatically in accordance with the system. The applicable scope of the mobile robot device was very broad. The operation flexibility is strong, and it can replace humans to complete difficult work tasks even in many dangerous and high-risk work areas. With the continuous development and progress of technology, mobile intelligent robot technology can have a certain cognition of the surrounding environment. In the application process, through the intervention of tactile sensors, visual sensors, and other devices, the robot can achieve a better cognition of the surrounding environment [1, 2]. Vision sensors installed in robots can be divided into monocular vision, binocular vision, and multi-eye vision. Most research has focused on the multi-eye view. Compared with monocular vision, multi-eye vision is more of sound vision, which can obtain three-dimensional integrated data of objects and create a real space, to achieve the purpose of product perception and target tracking. How to improve the effectiveness of impact assessment and the accuracy of target tracking is researched.


## 2. Literature Review

Binocular stereo vision was investigated earlier in many countries, and the technology had been applied to various mobile robots to complete various visual tasks. The EL-E family robot program, developed by a college, is equipped with a stereo vision system and full vision. The user could guide the robot to approach and grasp the target object through the matching green laser rod, which covered almost all daily objects, including water cups, remote controls, and books [3, 4]. Since the robot was guided to grasp by humans using laser pointer, it did not need to carry out the corresponding target recognition function. The operation method and principle were relatively simple. The target was separated from the obtained environmental image, and the three-dimensional coordinates of its centroid and the rotation angle of the scene plane were calculated to carry out the accurate grasp. The NAO robot developed by a company was equipped with a variety of sensors such as vision, infrared, and pressure. A binocular stereo vision sensor was installed in the head of the NAO robot. The object was recognized by edge detection and color segmentation of the image, and a three-dimensional model of the object was established. The Cosero robot, developed by a university, was equipped with a GRB-D sensor, namely, Kinect 3D sensor, which contained an infrared point cloud projection, a color camera, and an infrared camera to obtain both depth and color values of the scene. The Cosero robot runs on the platform, making shapes to get three combinations of average size and plane angle. et al. analyzed LASP-1 expression in RCC tissues by immunohistochemistry and Western blot analysis. Cell proliferation, migration, invasion, and gene expression were detected by CCK-8 method, Transwell method, and Western blotting. The results showed that LASP-1 was highly expressed in RCC, and its expression level t was positively correlated with lymph node metastasis and tumor, lymph node, and metastasis (TNM) stage. Knockdown of LASP-1 expression significantly inhibited RCC cell proliferation, increased apoptosis rate, and inhibited RCC cell invasion and migration by inhibiting epithelial-mesenchymal transition. In conclusion, LASP-1 promotes RCC progression and metastasis and is a promising therapeutic target for RCC [5]. Nour et al. discuss recent developments in cytoskeletal actin dynamics in liver fibrosis, including how the cellular microenvironment affects HSC function and the molecular mechanisms that regulate actin-induced increased collagen expression typical of activated HSCs [6].The research on binocular stereo vision in China was a little later than that in other countries, but with the unremitting research and hard work of Chinese researchers, remarkable achievements were made in binocular stereo vision. In view of the lack of intelligence in robot operation, a binocular vision system was built. The template matching technology was used to classify and recognize the feature points accurately. The pose of the target object was obtained through 3D reconstruction. A binocular stereo vision target recognition and capture method based on SURF+ RANSAC was proposed. The two methods were combined to match the image. The affine transformation was used to obtain key point information. Distance measurement and location were carried out according to 3D reconstruction. To solve the problem of target contour center mismatch in the two images obtained by the left and right cameras, the SURF algorithm was used to identify the target and GrabCut algorithm was automatically initialized to extract the target contour. Target location was carried out by template matching method combined with the principle of 3D reconstruction.


## 3. Binocular Stereo Vision System Based on Mobile Robot

### 3.1. Construction of Binocular Stereo Vision System

#### 3.1.1. Hardware Platform

The binocular camera ZED generation is selected for the research. It is a depth camera based on the RGB binocular stereo vision principle, which can be used both indoors and outdoors. The maximum depth range can reach 25 m. The highest of the resolution of depth map is 4416x1242@15FPS, which can also be adjusted according to the frame rate. The highest frame rate is 1344x376@100FPS. The maximum coverage field angle is 100°. The specific parameters are shown in Table1.Table 1
Main parameters of ZED camera.
Performance indicatorsParametersBaseline spacing120 mmFocal length2.8 mmDepth range0.5 m–25 mWeight170 gOperating temperature0°C–45°CSpecification size175 × 30 × 33 mmView scopeMax 90°(H) × 6°(V) × 100°(D)


#### 3.1.2. Software Platform

C++ language is created using Visual Studio 2013. The software pole diagram of the binocular system is shown in Figure1, which is divided into four parts.(1)
Image Acquisition. It includes communication with the upper computer through USB 3.0 interface, setting camera parameters, and obtaining image frames.(2)
Target Segmentation. The target area is segmented first, and then, the precise target segmentation is carried out.(3)
Target Recognition. Firstly, feature extraction is carried out. Then, the classifier trained is carried out. Finally, target recognition is carried out.(4)
Target Positioning. It includes polar line correction, stereo matching, and target pose estimation [7, 8].Figure 1
Software framework diagram of binocular system.


### 3.2. Camera Model

Camera imaging transformation includes the transformation of the target in four different coordinate systems, including the world coordinate system, camera coordinate system, image pixel coordinate system, and image physical coordinate system. Firstly, it is necessary to make clear the transformation relationship between these four coordinate systems.(1)
World coordinate system is expressed as follows:(1)Ow−XwYwZw.It is the absolute coordinate system used to represent the real world, which is the reference coordinate system for objects in the real world.(2)
Camera coordinate system is expressed as follows:(2)Oc−XcYcZc.It takes the camera light spot as the origin and Figure2 camera optical axis Zc as the axis.(3)
Image pixel coordinate system is expressed asOouv. The origin O0 represents the pixel point in the upper left corner of the digital image. The basis of the u-axis and v-axis is pixels, where the u-axis represents pixel lines and the v-axis represents pixel lines.(4)
Image physical coordinate system is expressed asO1xy, which plays a role in connecting camera coordinate system and image pixel coordinate system in the process of camera calibration. The coordinate origin O1 is the projection center u0,v0. x-axis is parallel to u-axis. y-axis is parallel to v-axis. To obtain the internal and external parameters of the camera, it is necessary to know the corresponding relationship between coordinate systems O1xy and Oouv. The coordinate system is established as shown in Figure 2.Figure 2
Image pixel coordinate system and image physical coordinate system.The relationship between the pixel coordinate system and the physical interaction of the image can be represented by the following model:(3)u=uo+xdx,v=vo+ydy.In formula (3), x,y represents the coordinates of any point in the material coordinate system. (u, v) represents the corresponding coordinates in the pixel coordinate system. dx and dy are the actual dimensions of a single pixel point. To facilitate transformation between coordinates, formula (3) is transformed into matrix form.(4)uv1=1dx0u001dyv0001xy1.Changing the relationship between the camera coordination and the global control system is an external measure of the camera. Global control system, camera control system, pixel control system, and human image integration are established, as shown in Figure3.Figure 3
Correspondence between the four coordinate systems.The relationship of the camera control integration with the global control system shows that(5)XcYcZc1=RTOT1XwYwZw1=M2XwYwZw1.In formula (5), R is the rotation matrix of order 3. T is the 3 × 1 translation vector.(6)OT=0,0,0.M2 is 4 × 4 matrix, in Figure 4, to simplify the conversion relationship.(1)
As shown in [9, 10], in the ideal conditions of physics, the camera is simplified as a particle, that is, a point approaching infinitesimal. When a beam of light shines on a plane with only one particle, the light cannot be transmitted to the other side through parallel lines. At this time, the light can only be fully projected to the imaging plane through the particle.Suppose a pointPXc,Yc,Zc in the camera coordinate system is projected onto the imaging plane by the camera’s optical center, forming an inverted image Plx,y. The imaging model can be obtained through similar triangles:(7)x=fXcZc,y=fYcZc.In formula (7), f is the focal length of the camera. The above equation can be simplified into a matrix as follows:(8)Zcxy1=f0000f000010XcYcZc1.Formula (5), formula (6), and formula (7) are combined to obtain the linear model of the camera.(9)Zcuv1=1dx0u001dyv0001f0000f000010RTOY1XwYwZw1,(10)Zcuv1=fx0u00fyv0001RTOY1XwYwZw1=M1M2XwYwZw1.In formula (9) and formula (10), fx=f/dx is the scale factor of focal length f on u-axis. fy=f/dy is the scale factor on v axis. M1 is the internal parameter matrix of the camera, which is determined jointly by f,dx,dy,u0,andvo. It is the inherent parameter, which does not change with environmental changes. M2 is the external camera parameter matrix, including rotation matrix R and translation vector T, which changes with position changes.(2)
Nonlinear Model. The linear model of the camera is affected by artificial conditions such as the production level of the product and integration error, which leads to problems in the quality of the lens or inaccurate measurement of the focal length of the lens. In this case, the linear model of the camera will have the corresponding distortion and the camera model is a nonlinear model [11, 12]. Distortion includes radial distortion, tangential distortion, and thin prism distortion. Thin prisms have almost no distractions in ZED cameras, so they can be ignored when talking about distractions. Radial distortion and tangential distortion are shown in Figure 5.Figure 4
Pinhole imaging model.Figure 5
Camera distortion model.The radial error of one pixel is called radial distortion. The distance from the pixel point to the optical center is positively affected by the degree of image distortion. The greater the distance, the greater the change. The radial distortion mode is set:(11)δxx,y=xk1r2+k2r4+k3r6+…,δyx,y=yk1r2+k2r4+k3r6+….In formula (11),(12)r=x2+y2.k1,k2,k3… are the radial distortion parameters. Under normal circumstances, the distortion is relatively small. Parameters can be set to k1 and k2.The position deviation of x- ory-axis caused by artificial problems of the lens or the camera not parallel to the imaging plane is called tangential distortion. The tangential distortion model is established.(13)δxx,y=2p2xy+p13x2+y2,δyx,y=2p1xy+p2x2+3y2.In formula (13), p1 and p2 are tangential distortion parameters. In combination with formula (11) and formula (13), the nonlinear model of the camera is as follows:(14)δxx,y=xk1x2+y2+k2x2+y22+2p2xy+p13x2+y2,δyx,y=yk1x2+y2+k2x2+y22+2p1xy+p2x2+3y2.


## 3.1. Construction of Binocular Stereo Vision System

### 3.1.1. Hardware Platform

The binocular camera ZED generation is selected for the research. It is a depth camera based on the RGB binocular stereo vision principle, which can be used both indoors and outdoors. The maximum depth range can reach 25 m. The highest of the resolution of depth map is 4416x1242@15FPS, which can also be adjusted according to the frame rate. The highest frame rate is 1344x376@100FPS. The maximum coverage field angle is 100°. The specific parameters are shown in Table1.Table 1
Main parameters of ZED camera.
Performance indicatorsParametersBaseline spacing120 mmFocal length2.8 mmDepth range0.5 m–25 mWeight170 gOperating temperature0°C–45°CSpecification size175 × 30 × 33 mmView scopeMax 90°(H) × 6°(V) × 100°(D)


### 3.1.2. Software Platform

C++ language is created using Visual Studio 2013. The software pole diagram of the binocular system is shown in Figure1, which is divided into four parts.(1)
Image Acquisition. It includes communication with the upper computer through USB 3.0 interface, setting camera parameters, and obtaining image frames.(2)
Target Segmentation. The target area is segmented first, and then, the precise target segmentation is carried out.(3)
Target Recognition. Firstly, feature extraction is carried out. Then, the classifier trained is carried out. Finally, target recognition is carried out.(4)
Target Positioning. It includes polar line correction, stereo matching, and target pose estimation [7, 8].Figure 1
Software framework diagram of binocular system.


## 3.1.1. Hardware Platform

The binocular camera ZED generation is selected for the research. It is a depth camera based on the RGB binocular stereo vision principle, which can be used both indoors and outdoors. The maximum depth range can reach 25 m. The highest of the resolution of depth map is 4416x1242@15FPS, which can also be adjusted according to the frame rate. The highest frame rate is 1344x376@100FPS. The maximum coverage field angle is 100°. The specific parameters are shown in Table1.Table 1
Main parameters of ZED camera.
Performance indicatorsParametersBaseline spacing120 mmFocal length2.8 mmDepth range0.5 m–25 mWeight170 gOperating temperature0°C–45°CSpecification size175 × 30 × 33 mmView scopeMax 90°(H) × 6°(V) × 100°(D)


## 3.1.2. Software Platform

C++ language is created using Visual Studio 2013. The software pole diagram of the binocular system is shown in Figure1, which is divided into four parts.(1)
Image Acquisition. It includes communication with the upper computer through USB 3.0 interface, setting camera parameters, and obtaining image frames.(2)
Target Segmentation. The target area is segmented first, and then, the precise target segmentation is carried out.(3)
Target Recognition. Firstly, feature extraction is carried out. Then, the classifier trained is carried out. Finally, target recognition is carried out.(4)
Target Positioning. It includes polar line correction, stereo matching, and target pose estimation [7, 8].Figure 1
Software framework diagram of binocular system.


## 3.2. Camera Model

Camera imaging transformation includes the transformation of the target in four different coordinate systems, including the world coordinate system, camera coordinate system, image pixel coordinate system, and image physical coordinate system. Firstly, it is necessary to make clear the transformation relationship between these four coordinate systems.(1)
World coordinate system is expressed as follows:(1)Ow−XwYwZw.It is the absolute coordinate system used to represent the real world, which is the reference coordinate system for objects in the real world.(2)
Camera coordinate system is expressed as follows:(2)Oc−XcYcZc.It takes the camera light spot as the origin and Figure2 camera optical axis Zc as the axis.(3)
Image pixel coordinate system is expressed asOouv. The origin O0 represents the pixel point in the upper left corner of the digital image. The basis of the u-axis and v-axis is pixels, where the u-axis represents pixel lines and the v-axis represents pixel lines.(4)
Image physical coordinate system is expressed asO1xy, which plays a role in connecting camera coordinate system and image pixel coordinate system in the process of camera calibration. The coordinate origin O1 is the projection center u0,v0. x-axis is parallel to u-axis. y-axis is parallel to v-axis. To obtain the internal and external parameters of the camera, it is necessary to know the corresponding relationship between coordinate systems O1xy and Oouv. The coordinate system is established as shown in Figure 2.Figure 2
Image pixel coordinate system and image physical coordinate system.The relationship between the pixel coordinate system and the physical interaction of the image can be represented by the following model:(3)u=uo+xdx,v=vo+ydy.In formula (3), x,y represents the coordinates of any point in the material coordinate system. (u, v) represents the corresponding coordinates in the pixel coordinate system. dx and dy are the actual dimensions of a single pixel point. To facilitate transformation between coordinates, formula (3) is transformed into matrix form.(4)uv1=1dx0u001dyv0001xy1.Changing the relationship between the camera coordination and the global control system is an external measure of the camera. Global control system, camera control system, pixel control system, and human image integration are established, as shown in Figure3.Figure 3
Correspondence between the four coordinate systems.The relationship of the camera control integration with the global control system shows that(5)XcYcZc1=RTOT1XwYwZw1=M2XwYwZw1.In formula (5), R is the rotation matrix of order 3. T is the 3 × 1 translation vector.(6)OT=0,0,0.M2 is 4 × 4 matrix, in Figure 4, to simplify the conversion relationship.(1)
As shown in [9, 10], in the ideal conditions of physics, the camera is simplified as a particle, that is, a point approaching infinitesimal. When a beam of light shines on a plane with only one particle, the light cannot be transmitted to the other side through parallel lines. At this time, the light can only be fully projected to the imaging plane through the particle.Suppose a pointPXc,Yc,Zc in the camera coordinate system is projected onto the imaging plane by the camera’s optical center, forming an inverted image Plx,y. The imaging model can be obtained through similar triangles:(7)x=fXcZc,y=fYcZc.In formula (7), f is the focal length of the camera. The above equation can be simplified into a matrix as follows:(8)Zcxy1=f0000f000010XcYcZc1.Formula (5), formula (6), and formula (7) are combined to obtain the linear model of the camera.(9)Zcuv1=1dx0u001dyv0001f0000f000010RTOY1XwYwZw1,(10)Zcuv1=fx0u00fyv0001RTOY1XwYwZw1=M1M2XwYwZw1.In formula (9) and formula (10), fx=f/dx is the scale factor of focal length f on u-axis. fy=f/dy is the scale factor on v axis. M1 is the internal parameter matrix of the camera, which is determined jointly by f,dx,dy,u0,andvo. It is the inherent parameter, which does not change with environmental changes. M2 is the external camera parameter matrix, including rotation matrix R and translation vector T, which changes with position changes.(2)
Nonlinear Model. The linear model of the camera is affected by artificial conditions such as the production level of the product and integration error, which leads to problems in the quality of the lens or inaccurate measurement of the focal length of the lens. In this case, the linear model of the camera will have the corresponding distortion and the camera model is a nonlinear model [11, 12]. Distortion includes radial distortion, tangential distortion, and thin prism distortion. Thin prisms have almost no distractions in ZED cameras, so they can be ignored when talking about distractions. Radial distortion and tangential distortion are shown in Figure 5.Figure 4
Pinhole imaging model.Figure 5
Camera distortion model.The radial error of one pixel is called radial distortion. The distance from the pixel point to the optical center is positively affected by the degree of image distortion. The greater the distance, the greater the change. The radial distortion mode is set:(11)δxx,y=xk1r2+k2r4+k3r6+…,δyx,y=yk1r2+k2r4+k3r6+….In formula (11),(12)r=x2+y2.k1,k2,k3… are the radial distortion parameters. Under normal circumstances, the distortion is relatively small. Parameters can be set to k1 and k2.The position deviation of x- ory-axis caused by artificial problems of the lens or the camera not parallel to the imaging plane is called tangential distortion. The tangential distortion model is established.(13)δxx,y=2p2xy+p13x2+y2,δyx,y=2p1xy+p2x2+3y2.In formula (13), p1 and p2 are tangential distortion parameters. In combination with formula (11) and formula (13), the nonlinear model of the camera is as follows:(14)δxx,y=xk1x2+y2+k2x2+y22+2p2xy+p13x2+y2,δyx,y=yk1x2+y2+k2x2+y22+2p1xy+p2x2+3y2.


## 4. Binocular Camera Calibration and Stereo Correction

### 4.1. Binocular Camera Calibration Based on Control Variable Method

Since the focal length determines the accuracy of the focal depthD, this section uses the differential control method to study the influence of the size of the checkerboard calibration plate and the distance of the calibration scale on the error calibration and obtains a high-precision focal length f.


#### 4.1.1. Experiment a

The calibration distance is set as 1600 mm, and checkerboard calibration plates of different specifications are drawn [13, 14]. The most immediate purpose of a dual-target fixed camera is to compute interior and exterior measurements for further integration from the center of the image to the triangle. Due to the binocular calibration completed by OpenCV, the results of multiple calibration may be unstable and even serious errors may occur, resulting in large deviations. Therefore, the identification system uses the MATLAB calibration toolbox with high accuracy to calibrate the binocular camera. The flow chart of the calibration process is shown in Figure 6.Figure 6
Flow chart of binocular camera calibration.


#### 4.1.2. Experiment b

The specification of checkerboard calibration plate is set as 26 mm × 26 mm. 12 groups of different calibration distances are set, with an increase of 100 mm from 800 mm to 1900 mm. Other conditions are consistent with Experiment a [15, 16].


### 4.2. Experimental Results and Analysis

The calibration error is the reverse projection error. The ideal value is zero; generally, less than 0.5 pixel can be used. Average calibration errors of each time can be obtained through the MATLAB calibration toolbox. The average calibration errors of experiments a andb are shown in Tables 2 and 3.Table 2
Average calibration error of Experiment a.
Specification of calibration plate (mm)Average calibration error (px)81.23844121.01541140.82457160.74556180.64574200.45255220.38452240.26634260.18542280.22524300.25785400.68345Table 3
Average calibration error of Experiment b.
Specification of calibration plate (mm)Average calibration error (px)8000.365419000.3498210000.2836411000.2495612000.2235713000.1935214000.2214315000.2645116000.2945217000.33156180003447819000.38542According to Experiment a, the average calibration error of the checkerboard calibration plate with the specification of 26 mm × 26 mm is the smallest and that of the checkerboard calibration plate with the specification of 8 mm × 8 mm is the largest. The average calibration error of the calibration plate with the specification of 8 mm × 8 mm increases from 26 mm × 26 mm, and the average calibration error decreases. In the process of 26 mm × 26 mm to 40 mm × 40 mm growth, the average calibration error shows a downward trend [17, 18]. According to test b, when the calibration distance is 1300 mm, the average calibration error is the lowest. When the calibration distance is 1900 mm, the average calibration error is the largest. When the calibration distance increases from 800 mm to 1300 mm, the average calibration error shows a downward trend. When the calibration distance increases from 1300 mm to 1900 mm, the average calibration error shows a downward trend. Therefore, a checkerboard calibration board with a specification of 26 mm × 26 mm was selected in the research and the calibration distance was 1300 mm. The internal and external parameters of the left and right cameras after the binocular calibration are shown in Table 4.Table 4
Results of binocular calibration.
ParametersResults of binocular calibrationLeft cameraRight cameraCamera intrinsic parametersfx2558.685556.4126fy2556.491557.5483Cx1020.171021.959Cy856.3736857.8058K1−0.051440.08049K20.113520.548P1−0.00390.00314P2−0.003070.00325K300Average error0.168660.16327External parametersR[−001944 −0.01157 −0.0165801]T[−150.95861 −0.00125 0.00208]As can be seen from Table4, by setting the checkerboard calibration plate of 26 mm × 26 mm and the calibration distance of 1300 mm, the difference between fx and fy obtained by the binocular calibration test is very small, which can make the accuracy of f higher. The rotation vector is as follows:(15)R=−0.01944−0.01157−0.016580.The items in the above formula are approximate to 0, indicating that there is almost no relative rotation between left and right cameras. The translation vector is as follows:(16)T=−150.95861−0.00125−0.00208.The first item −150.95861 represents the distance between the left and rightx-axis of the camera, that is, the distance from the base, which is consistent with the actual value of 150 mm. Therefore, binocular vision can be considered a visual impairment. To obtain the optimum viscosity of the binocular surface, high-pressure operation can be carried out. MATLAB 2016a calibration toolbox is used to calibrate the left and right cameras, respectively. The control variable method in physics is introduced to conduct comparative tests by setting different calibration plate specifications and calibration distance. Finally, the calibration distance is set as 1300 mm and the calibration plate specifications are positioned as 26 mm × 26 mm. The system achieves the optimal parameters and obtains the camera’s internal and external parameters with high accuracy, which provides a guarantee for calculating the obstacle distance. Due to camera distortion, manual installation, and other reasons, it is difficult to directly achieve the ideal binocular vision system in real operation. Therefore, after completing binocular camera calibration, the Bouguet stereo correction algorithm based on OpenCV is adopted to complete stereo correction. By analyzing the binocular calibration results and effect pictures after stereo correction, it can be seen that the system has basically reached the ideal binocular vision system.


### 4.3. Binocular Stereo Matching Algorithm

#### 4.3.1. Binocular Stereo Matching Process

The section aims to design an effective stereo matching algorithm in the intelligent parking environment [19, 20]. The steps of stereo matching are generally divided into four steps, as shown in Figure 7.Figure 7
Steps of stereo matching.Calculating the matching cost is to collect the corresponding points in the left and right views under different parallax and calculate their similarity. Traditional matching cost methods include normalized correlation coefficient (NCC), square of gray difference (SD), and absolute value of gray difference (AD).Comparing values together creates connections between adjacent pixels and adjusts matrix values according to certain rules so that nominal values can affect pixel correlation. The common matching cost aggregation methods include dynamic programming, path clustering, and scan line clustering. Parallax calculation is to use the cost matrix after cost aggregation to select the optimal parallax value. A winner-take-all approach is usually used to complete parallax calculation [21, 22].The common parallax optimization methods include left-right check, median filter, and intensity consistent. Since the parallax value obtained by the winner-take-all algorithm is the whole lower pixel accuracy, the unary quadratic curve fitting method is usually used to obtain higher sub-pixel accuracy.


#### 4.3.2. Stereo Matching Classification

Based on the classification using the stereo hybrid algorithm, the hybrid algorithm is divided into two categories according to the role of its time limit: the international integration algorithm and the local matching algorithm, as shown in Figure8. Global comparison algorithms generally include intelligent algorithms such as algorithm matching based on reliable propagation, dynamic programming methods, matching algorithms, and graph cut methods. It obtains a high matching accuracy at the expense of time and through a large number of calculations, which will not be able to meet the intelligent garage parking robot obstacle recognition system for real-time requirements. Basic matching algorithms can be subdivided into combination-based algorithms, feature-based matching algorithms, and phase-based matching algorithms based on different terms. It has the characteristics of low computational complexity and good real-time performance. Due to the real-time requirements of the stereo synthesis algorithm in the research, the local stereo algorithm is studied, and a stereo synthesis algorithm that can meet the needs of the scene is established, intelligent parking.Figure 8
Classification of stereo matching algorithms.By comparing the above three local matching algorithms, the application environment of the system is the intelligent parking garage environment with uneven light and weak light, so the feature-based matching algorithm was selected to solve the problem. The traditional feature matching algorithms SIFT and SURF were investigated and an improved algorithm was proposed to adapt to the application environment of the system, so that stereo matching could meet the real-time and precision requirements of the system.


## 4.1. Binocular Camera Calibration Based on Control Variable Method

Since the focal length determines the accuracy of the focal depthD, this section uses the differential control method to study the influence of the size of the checkerboard calibration plate and the distance of the calibration scale on the error calibration and obtains a high-precision focal length f.


### 4.1.1. Experiment a

The calibration distance is set as 1600 mm, and checkerboard calibration plates of different specifications are drawn [13, 14]. The most immediate purpose of a dual-target fixed camera is to compute interior and exterior measurements for further integration from the center of the image to the triangle. Due to the binocular calibration completed by OpenCV, the results of multiple calibration may be unstable and even serious errors may occur, resulting in large deviations. Therefore, the identification system uses the MATLAB calibration toolbox with high accuracy to calibrate the binocular camera. The flow chart of the calibration process is shown in Figure 6.Figure 6
Flow chart of binocular camera calibration.


### 4.1.2. Experiment b

The specification of checkerboard calibration plate is set as 26 mm × 26 mm. 12 groups of different calibration distances are set, with an increase of 100 mm from 800 mm to 1900 mm. Other conditions are consistent with Experiment a [15, 16].


## 4.1.1. Experiment a

The calibration distance is set as 1600 mm, and checkerboard calibration plates of different specifications are drawn [13, 14]. The most immediate purpose of a dual-target fixed camera is to compute interior and exterior measurements for further integration from the center of the image to the triangle. Due to the binocular calibration completed by OpenCV, the results of multiple calibration may be unstable and even serious errors may occur, resulting in large deviations. Therefore, the identification system uses the MATLAB calibration toolbox with high accuracy to calibrate the binocular camera. The flow chart of the calibration process is shown in Figure 6.Figure 6
Flow chart of binocular camera calibration.


## 4.1.2. Experiment b

The specification of checkerboard calibration plate is set as 26 mm × 26 mm. 12 groups of different calibration distances are set, with an increase of 100 mm from 800 mm to 1900 mm. Other conditions are consistent with Experiment a [15, 16].


## 4.2. Experimental Results and Analysis

The calibration error is the reverse projection error. The ideal value is zero; generally, less than 0.5 pixel can be used. Average calibration errors of each time can be obtained through the MATLAB calibration toolbox. The average calibration errors of experiments a andb are shown in Tables 2 and 3.Table 2
Average calibration error of Experiment a.
Specification of calibration plate (mm)Average calibration error (px)81.23844121.01541140.82457160.74556180.64574200.45255220.38452240.26634260.18542280.22524300.25785400.68345Table 3
Average calibration error of Experiment b.
Specification of calibration plate (mm)Average calibration error (px)8000.365419000.3498210000.2836411000.2495612000.2235713000.1935214000.2214315000.2645116000.2945217000.33156180003447819000.38542According to Experiment a, the average calibration error of the checkerboard calibration plate with the specification of 26 mm × 26 mm is the smallest and that of the checkerboard calibration plate with the specification of 8 mm × 8 mm is the largest. The average calibration error of the calibration plate with the specification of 8 mm × 8 mm increases from 26 mm × 26 mm, and the average calibration error decreases. In the process of 26 mm × 26 mm to 40 mm × 40 mm growth, the average calibration error shows a downward trend [17, 18]. According to test b, when the calibration distance is 1300 mm, the average calibration error is the lowest. When the calibration distance is 1900 mm, the average calibration error is the largest. When the calibration distance increases from 800 mm to 1300 mm, the average calibration error shows a downward trend. When the calibration distance increases from 1300 mm to 1900 mm, the average calibration error shows a downward trend. Therefore, a checkerboard calibration board with a specification of 26 mm × 26 mm was selected in the research and the calibration distance was 1300 mm. The internal and external parameters of the left and right cameras after the binocular calibration are shown in Table 4.Table 4
Results of binocular calibration.
ParametersResults of binocular calibrationLeft cameraRight cameraCamera intrinsic parametersfx2558.685556.4126fy2556.491557.5483Cx1020.171021.959Cy856.3736857.8058K1−0.051440.08049K20.113520.548P1−0.00390.00314P2−0.003070.00325K300Average error0.168660.16327External parametersR[−001944 −0.01157 −0.0165801]T[−150.95861 −0.00125 0.00208]As can be seen from Table4, by setting the checkerboard calibration plate of 26 mm × 26 mm and the calibration distance of 1300 mm, the difference between fx and fy obtained by the binocular calibration test is very small, which can make the accuracy of f higher. The rotation vector is as follows:(15)R=−0.01944−0.01157−0.016580.The items in the above formula are approximate to 0, indicating that there is almost no relative rotation between left and right cameras. The translation vector is as follows:(16)T=−150.95861−0.00125−0.00208.The first item −150.95861 represents the distance between the left and rightx-axis of the camera, that is, the distance from the base, which is consistent with the actual value of 150 mm. Therefore, binocular vision can be considered a visual impairment. To obtain the optimum viscosity of the binocular surface, high-pressure operation can be carried out. MATLAB 2016a calibration toolbox is used to calibrate the left and right cameras, respectively. The control variable method in physics is introduced to conduct comparative tests by setting different calibration plate specifications and calibration distance. Finally, the calibration distance is set as 1300 mm and the calibration plate specifications are positioned as 26 mm × 26 mm. The system achieves the optimal parameters and obtains the camera’s internal and external parameters with high accuracy, which provides a guarantee for calculating the obstacle distance. Due to camera distortion, manual installation, and other reasons, it is difficult to directly achieve the ideal binocular vision system in real operation. Therefore, after completing binocular camera calibration, the Bouguet stereo correction algorithm based on OpenCV is adopted to complete stereo correction. By analyzing the binocular calibration results and effect pictures after stereo correction, it can be seen that the system has basically reached the ideal binocular vision system.


## 4.3. Binocular Stereo Matching Algorithm

### 4.3.1. Binocular Stereo Matching Process

The section aims to design an effective stereo matching algorithm in the intelligent parking environment [19, 20]. The steps of stereo matching are generally divided into four steps, as shown in Figure 7.Figure 7
Steps of stereo matching.Calculating the matching cost is to collect the corresponding points in the left and right views under different parallax and calculate their similarity. Traditional matching cost methods include normalized correlation coefficient (NCC), square of gray difference (SD), and absolute value of gray difference (AD).Comparing values together creates connections between adjacent pixels and adjusts matrix values according to certain rules so that nominal values can affect pixel correlation. The common matching cost aggregation methods include dynamic programming, path clustering, and scan line clustering. Parallax calculation is to use the cost matrix after cost aggregation to select the optimal parallax value. A winner-take-all approach is usually used to complete parallax calculation [21, 22].The common parallax optimization methods include left-right check, median filter, and intensity consistent. Since the parallax value obtained by the winner-take-all algorithm is the whole lower pixel accuracy, the unary quadratic curve fitting method is usually used to obtain higher sub-pixel accuracy.


### 4.3.2. Stereo Matching Classification

Based on the classification using the stereo hybrid algorithm, the hybrid algorithm is divided into two categories according to the role of its time limit: the international integration algorithm and the local matching algorithm, as shown in Figure8. Global comparison algorithms generally include intelligent algorithms such as algorithm matching based on reliable propagation, dynamic programming methods, matching algorithms, and graph cut methods. It obtains a high matching accuracy at the expense of time and through a large number of calculations, which will not be able to meet the intelligent garage parking robot obstacle recognition system for real-time requirements. Basic matching algorithms can be subdivided into combination-based algorithms, feature-based matching algorithms, and phase-based matching algorithms based on different terms. It has the characteristics of low computational complexity and good real-time performance. Due to the real-time requirements of the stereo synthesis algorithm in the research, the local stereo algorithm is studied, and a stereo synthesis algorithm that can meet the needs of the scene is established, intelligent parking.Figure 8
Classification of stereo matching algorithms.By comparing the above three local matching algorithms, the application environment of the system is the intelligent parking garage environment with uneven light and weak light, so the feature-based matching algorithm was selected to solve the problem. The traditional feature matching algorithms SIFT and SURF were investigated and an improved algorithm was proposed to adapt to the application environment of the system, so that stereo matching could meet the real-time and precision requirements of the system.


## 4.3.1. Binocular Stereo Matching Process

The section aims to design an effective stereo matching algorithm in the intelligent parking environment [19, 20]. The steps of stereo matching are generally divided into four steps, as shown in Figure 7.Figure 7
Steps of stereo matching.Calculating the matching cost is to collect the corresponding points in the left and right views under different parallax and calculate their similarity. Traditional matching cost methods include normalized correlation coefficient (NCC), square of gray difference (SD), and absolute value of gray difference (AD).Comparing values together creates connections between adjacent pixels and adjusts matrix values according to certain rules so that nominal values can affect pixel correlation. The common matching cost aggregation methods include dynamic programming, path clustering, and scan line clustering. Parallax calculation is to use the cost matrix after cost aggregation to select the optimal parallax value. A winner-take-all approach is usually used to complete parallax calculation [21, 22].The common parallax optimization methods include left-right check, median filter, and intensity consistent. Since the parallax value obtained by the winner-take-all algorithm is the whole lower pixel accuracy, the unary quadratic curve fitting method is usually used to obtain higher sub-pixel accuracy.


## 4.3.2. Stereo Matching Classification

Based on the classification using the stereo hybrid algorithm, the hybrid algorithm is divided into two categories according to the role of its time limit: the international integration algorithm and the local matching algorithm, as shown in Figure8. Global comparison algorithms generally include intelligent algorithms such as algorithm matching based on reliable propagation, dynamic programming methods, matching algorithms, and graph cut methods. It obtains a high matching accuracy at the expense of time and through a large number of calculations, which will not be able to meet the intelligent garage parking robot obstacle recognition system for real-time requirements. Basic matching algorithms can be subdivided into combination-based algorithms, feature-based matching algorithms, and phase-based matching algorithms based on different terms. It has the characteristics of low computational complexity and good real-time performance. Due to the real-time requirements of the stereo synthesis algorithm in the research, the local stereo algorithm is studied, and a stereo synthesis algorithm that can meet the needs of the scene is established, intelligent parking.Figure 8
Classification of stereo matching algorithms.By comparing the above three local matching algorithms, the application environment of the system is the intelligent parking garage environment with uneven light and weak light, so the feature-based matching algorithm was selected to solve the problem. The traditional feature matching algorithms SIFT and SURF were investigated and an improved algorithm was proposed to adapt to the application environment of the system, so that stereo matching could meet the real-time and precision requirements of the system.


## 5. Experiment and Analysis of Obstacle Recognition System

In the research, the parking robot obstacle recognition system needs to realize not only the distance detection of obstacles in front of the parking path to ensure the safety of the parking process. In addition, biological and nonbiological types of obstacles should be detected. If it is detected that creatures (people, cats, and dogs) enter by mistake, the progress should be stopped and the garage management personnel should be notified to intervene. If it is nonbiological type, autonomous obstacle avoidance should be carried out and the management personnel should be notified. Therefore, obstacle recognition methods were explored in the section and YOLO convolutional neural network was selected as the obstacle recognition module of the system. Experiment verification and results analysis on the obstacle recognition system were carried out [23, 24].


### 5.1. Obstacle Category Detection Research Based on YOLO Convolutional Neural Network

The old product search process can be divided into three parts: selecting regions (sliding window), removing features (HAAR, HOG, etc.), and classifiers (SVM, AdaBoost, etc.). The main problems are as follows. On the other hand, the feature robustness of manual extraction is poor. Since entering the era of deep learning, object category detection has achieved unprecedented development, and the most eye-catching two directions are as follows: region proposal-based deep learning object detection algorithm represented by RCNN (RCNN, fast-RCNN, etc.). They are two-staged. Firstly, region proposal is generated using the selective search method. Then, the data are classified and regressed in region proposal—represented by deep learning target detection algorithm (YOLO, SSD, etc.), which only uses a CNN to directly predict the categories and locations of different targets.The YOLO convolutional neural network model consists of a convolution process, a pooling layer, and all layers. It directly applies the image as input and returns the location and category of the target box in the output layer. Similar to GoogleNet, the network has 24 convolutional layers and 2 fully connected layers. The steps of YOLO convolutional neural network for recognition purposes are as follows. First, the convolution procedure is trained on Pascal VOC data. The RPN is then designed to use the convolution process and all layers. Finally, the class target and target image location are estimated.The YOLO convolutional neural network algorithm firstly divides the input image intoS×S grid cells and then predicts B bounding boxes for each cell. Each box contains five predicted values, namely, x,y,w,h, and confidence. x,y represents the position of the center of the detection border relative to the grid. w and h indicate the width and height of the detection frame, respectively. Each grid predicts the probability of C hypothetical categories and finally outputs a feature graph with size of S×S×B×5+C. Pascal VOC training data are used, such as training 20 categories; S = 7, B = 2, and C = 20, and then, the output characteristic graph is 7 × 7 × 30.The confidence of each prediction box containing the target is defined as follows:(17)PrObject×IOUpredtruth.If the prediction box contains objects, thenPObject=1, and otherwise, PObject=0; the probability value of defining the prediction condition for each grid is as follows:(18)C=PrClassi|Object.It represents the probability that the grid has a group, and the relationship between the two numbers is shown as follows:(19)PrClassi|Object×PrObject×IOUpredtruth.After getting the credible value of each prediction box, the threshold is set. Predictions with low scores are filtered. The prediction box is done by NMS. The final examination is obtained.YOLO convolutional neural network uses error average as loss function. It divides the image intoS×S grids. Each grid has (B × 5 + C) dimension data, including (B × 4) dimension position information of detection frame, (B × 1) dimension confidence of detection frame, and C dimension category probability. To solve the problem that different classification errors are treated equally and the training object center does not fall on the grid, leading to the training instability, in YOLO convolutional neural network, the positioning error is designed with the weight of 5. The confidence error is designed with the weight of 0.5 for the grid that does not contain the center of the training object. The classification error and the confidence error of the grid that contain the center of the training object remain unchanged. The length and width errors of the detection frame are more sensitive than the positioning errors. So, the network w is replaced by w and h is replaced by h. The loss function of YOLO convolutional neural network is as follows.(20)Loss=λcoord∑i=0s2∑j=0Bxi−x^j2+yi−y^i2+,λcoord∑i=0s2∑j=0BIijobjwi−w^i+hi−h^i2+,∑i=0s2∑j=0BIijobjCi−C^i2+λcoord∑i=0s2∑j=0BIijnoobjCi−C^i2+,∑i=0s2Iijobj∑c∈classespic−p^ic2.As the application environment is garage, the data set provided by the authorities is rich in categories, with high-quality images and large number of training samples, which can meet the detection of basic obstacles, including biological categories such as human, cat, and dog and nonbiological categories such as cars, bikes, and bottles. Therefore, its own data set is not retrained, but the weight file provided by YOLO (containing 20 target categories) is used to conduct 4 groups of obstacle category detection experiments [25].The target detection method based on YOLO convolutional neural network can complete the detection of obstacle categories in the parking garage environment. The performance analysis of the detection of four groups of object categories of single target recognition and multiple target recognition is shown in Table5.Table 5
Analysis of obstacle recognition performance of YOLO convolutional neural network.
GroupTarget category (from left to right)Confidence level (%)xywhTime-consuming (s)(a)Dog100357293544090.089(b)Bicycle1003024995334080.088Car98321019170(c)Car3816522054490.095Person9934229121321(d)Car94581170901140.116Car9001146787Car961210914369Car99325127332238Car655711234249Car99587117176156It can be seen from Table5 that the weight files provided by the authorities can be used to complete the classification detection of common obstacles in the parking garage environment, with high detection accuracy and time-consuming at the millisecond level, which can fully meet the real-time requirements of obstacle category detection of parking robots.


### 5.2. Experiment and Result Analysis of Obstacle Recognition System

#### 5.2.1. Overall Algorithm Design of the System

Figure9 shows the flow chart of algorithm realization of the whole system. Firstly, the binocular camera is used to collect the parking garage image pairs. The control variable method in physics is introduced, and the binocular camera calibration is completed through MATLAB toolbox. The calibration parameters are combined with the Bouguet stereo correction algorithm to complete stereo correction. Then, YOLO convolutional neural network is used to complete obstacle recognition and rectangular frame is used to circle the image range of obstacle. The improved SURF stereo matching algorithm is used to extract the feature points of the left and right images. Finally, combining the YOLO circle convolution neural network image coordinates (x, y) and an obstruction of left and right images for matching feature points, the parallax of all the feature points in the rectangular frame is calculated. The maximum value for parallax is chosen. The binocular ranging method is used to calculate the minimum depth of obstacles in order to understand the output of obstacle category and distance information.Figure 9
Flow chart of obstacle identification system algorithm.


#### 5.2.2. Experimental Results and Analysis

As the application environment of this system is underground parking garage, aiming at the weak and uneven illumination in this environment, the effectiveness of the obstacle identification system in the research is verified, including the ranging accuracy of the system, the accuracy of obstacle detection, and real-timeness. In the research, the obstacle is set as a person who enters the parking garage by mistake, and different distances from 1000 mm to 2100 mm are set for testing, with an interval of 100 mm for each group. The system test results use four matching algorithms to calculate the distance of the obstacle. The ranging results are shown in Table6, and the average time of the system is shown in Table 7.Table 6
Ranging results of four matching algorithms.
Actual distance (mm)SIFT algorithmSURF algorithmFAST algorithmAlgorithm in the research10001012.91011.81021.51009.711001115.41114.21126.21112.512001219.51218.11230.11216.913001322.31321.21333.21319.614001426.31425.71437.91423.515001531.61530.11542.81527.216001637.11636.51648.71630.917001746.11747.81752.61734.518001852.41853.91862.21839.119001968.61969.21979.51943.520002096.22097.52115.82046.921002211.52212.42254.92149.8Table 7
Average system time.
NameTime-consuming (s)Stereo matching module0.256Obstacle-type detection module0.096Obstacle identification system0.466As can be seen from Table7, the conceptual algorithm is much more accurate compared with the local problems based on SIFT, SURF, and FAST algorithms. As the distance increases, the data edge interference starts to decrease when the impact distance exceeds 1600 mm. The number of similar points is reduced by improving the SURF algorithm. However, the difference in reality has not changed much, and the energy is very strong. As can be seen from Table 7, the total time consumption and the impact experience of each part are in milliseconds, which can be satisfied in real time.


## 5.1. Obstacle Category Detection Research Based on YOLO Convolutional Neural Network

The old product search process can be divided into three parts: selecting regions (sliding window), removing features (HAAR, HOG, etc.), and classifiers (SVM, AdaBoost, etc.). The main problems are as follows. On the other hand, the feature robustness of manual extraction is poor. Since entering the era of deep learning, object category detection has achieved unprecedented development, and the most eye-catching two directions are as follows: region proposal-based deep learning object detection algorithm represented by RCNN (RCNN, fast-RCNN, etc.). They are two-staged. Firstly, region proposal is generated using the selective search method. Then, the data are classified and regressed in region proposal—represented by deep learning target detection algorithm (YOLO, SSD, etc.), which only uses a CNN to directly predict the categories and locations of different targets.The YOLO convolutional neural network model consists of a convolution process, a pooling layer, and all layers. It directly applies the image as input and returns the location and category of the target box in the output layer. Similar to GoogleNet, the network has 24 convolutional layers and 2 fully connected layers. The steps of YOLO convolutional neural network for recognition purposes are as follows. First, the convolution procedure is trained on Pascal VOC data. The RPN is then designed to use the convolution process and all layers. Finally, the class target and target image location are estimated.The YOLO convolutional neural network algorithm firstly divides the input image intoS×S grid cells and then predicts B bounding boxes for each cell. Each box contains five predicted values, namely, x,y,w,h, and confidence. x,y represents the position of the center of the detection border relative to the grid. w and h indicate the width and height of the detection frame, respectively. Each grid predicts the probability of C hypothetical categories and finally outputs a feature graph with size of S×S×B×5+C. Pascal VOC training data are used, such as training 20 categories; S = 7, B = 2, and C = 20, and then, the output characteristic graph is 7 × 7 × 30.The confidence of each prediction box containing the target is defined as follows:(17)PrObject×IOUpredtruth.If the prediction box contains objects, thenPObject=1, and otherwise, PObject=0; the probability value of defining the prediction condition for each grid is as follows:(18)C=PrClassi|Object.It represents the probability that the grid has a group, and the relationship between the two numbers is shown as follows:(19)PrClassi|Object×PrObject×IOUpredtruth.After getting the credible value of each prediction box, the threshold is set. Predictions with low scores are filtered. The prediction box is done by NMS. The final examination is obtained.YOLO convolutional neural network uses error average as loss function. It divides the image intoS×S grids. Each grid has (B × 5 + C) dimension data, including (B × 4) dimension position information of detection frame, (B × 1) dimension confidence of detection frame, and C dimension category probability. To solve the problem that different classification errors are treated equally and the training object center does not fall on the grid, leading to the training instability, in YOLO convolutional neural network, the positioning error is designed with the weight of 5. The confidence error is designed with the weight of 0.5 for the grid that does not contain the center of the training object. The classification error and the confidence error of the grid that contain the center of the training object remain unchanged. The length and width errors of the detection frame are more sensitive than the positioning errors. So, the network w is replaced by w and h is replaced by h. The loss function of YOLO convolutional neural network is as follows.(20)Loss=λcoord∑i=0s2∑j=0Bxi−x^j2+yi−y^i2+,λcoord∑i=0s2∑j=0BIijobjwi−w^i+hi−h^i2+,∑i=0s2∑j=0BIijobjCi−C^i2+λcoord∑i=0s2∑j=0BIijnoobjCi−C^i2+,∑i=0s2Iijobj∑c∈classespic−p^ic2.As the application environment is garage, the data set provided by the authorities is rich in categories, with high-quality images and large number of training samples, which can meet the detection of basic obstacles, including biological categories such as human, cat, and dog and nonbiological categories such as cars, bikes, and bottles. Therefore, its own data set is not retrained, but the weight file provided by YOLO (containing 20 target categories) is used to conduct 4 groups of obstacle category detection experiments [25].The target detection method based on YOLO convolutional neural network can complete the detection of obstacle categories in the parking garage environment. The performance analysis of the detection of four groups of object categories of single target recognition and multiple target recognition is shown in Table5.Table 5
Analysis of obstacle recognition performance of YOLO convolutional neural network.
GroupTarget category (from left to right)Confidence level (%)xywhTime-consuming (s)(a)Dog100357293544090.089(b)Bicycle1003024995334080.088Car98321019170(c)Car3816522054490.095Person9934229121321(d)Car94581170901140.116Car9001146787Car961210914369Car99325127332238Car655711234249Car99587117176156It can be seen from Table5 that the weight files provided by the authorities can be used to complete the classification detection of common obstacles in the parking garage environment, with high detection accuracy and time-consuming at the millisecond level, which can fully meet the real-time requirements of obstacle category detection of parking robots.


## 5.2. Experiment and Result Analysis of Obstacle Recognition System

### 5.2.1. Overall Algorithm Design of the System

Figure9 shows the flow chart of algorithm realization of the whole system. Firstly, the binocular camera is used to collect the parking garage image pairs. The control variable method in physics is introduced, and the binocular camera calibration is completed through MATLAB toolbox. The calibration parameters are combined with the Bouguet stereo correction algorithm to complete stereo correction. Then, YOLO convolutional neural network is used to complete obstacle recognition and rectangular frame is used to circle the image range of obstacle. The improved SURF stereo matching algorithm is used to extract the feature points of the left and right images. Finally, combining the YOLO circle convolution neural network image coordinates (x, y) and an obstruction of left and right images for matching feature points, the parallax of all the feature points in the rectangular frame is calculated. The maximum value for parallax is chosen. The binocular ranging method is used to calculate the minimum depth of obstacles in order to understand the output of obstacle category and distance information.Figure 9
Flow chart of obstacle identification system algorithm.


### 5.2.2. Experimental Results and Analysis

As the application environment of this system is underground parking garage, aiming at the weak and uneven illumination in this environment, the effectiveness of the obstacle identification system in the research is verified, including the ranging accuracy of the system, the accuracy of obstacle detection, and real-timeness. In the research, the obstacle is set as a person who enters the parking garage by mistake, and different distances from 1000 mm to 2100 mm are set for testing, with an interval of 100 mm for each group. The system test results use four matching algorithms to calculate the distance of the obstacle. The ranging results are shown in Table6, and the average time of the system is shown in Table 7.Table 6
Ranging results of four matching algorithms.
Actual distance (mm)SIFT algorithmSURF algorithmFAST algorithmAlgorithm in the research10001012.91011.81021.51009.711001115.41114.21126.21112.512001219.51218.11230.11216.913001322.31321.21333.21319.614001426.31425.71437.91423.515001531.61530.11542.81527.216001637.11636.51648.71630.917001746.11747.81752.61734.518001852.41853.91862.21839.119001968.61969.21979.51943.520002096.22097.52115.82046.921002211.52212.42254.92149.8Table 7
Average system time.
NameTime-consuming (s)Stereo matching module0.256Obstacle-type detection module0.096Obstacle identification system0.466As can be seen from Table7, the conceptual algorithm is much more accurate compared with the local problems based on SIFT, SURF, and FAST algorithms. As the distance increases, the data edge interference starts to decrease when the impact distance exceeds 1600 mm. The number of similar points is reduced by improving the SURF algorithm. However, the difference in reality has not changed much, and the energy is very strong. As can be seen from Table 7, the total time consumption and the impact experience of each part are in milliseconds, which can be satisfied in real time.


## 5.2.1. Overall Algorithm Design of the System

Figure9 shows the flow chart of algorithm realization of the whole system. Firstly, the binocular camera is used to collect the parking garage image pairs. The control variable method in physics is introduced, and the binocular camera calibration is completed through MATLAB toolbox. The calibration parameters are combined with the Bouguet stereo correction algorithm to complete stereo correction. Then, YOLO convolutional neural network is used to complete obstacle recognition and rectangular frame is used to circle the image range of obstacle. The improved SURF stereo matching algorithm is used to extract the feature points of the left and right images. Finally, combining the YOLO circle convolution neural network image coordinates (x, y) and an obstruction of left and right images for matching feature points, the parallax of all the feature points in the rectangular frame is calculated. The maximum value for parallax is chosen. The binocular ranging method is used to calculate the minimum depth of obstacles in order to understand the output of obstacle category and distance information.Figure 9
Flow chart of obstacle identification system algorithm.


## 5.2.2. Experimental Results and Analysis

As the application environment of this system is underground parking garage, aiming at the weak and uneven illumination in this environment, the effectiveness of the obstacle identification system in the research is verified, including the ranging accuracy of the system, the accuracy of obstacle detection, and real-timeness. In the research, the obstacle is set as a person who enters the parking garage by mistake, and different distances from 1000 mm to 2100 mm are set for testing, with an interval of 100 mm for each group. The system test results use four matching algorithms to calculate the distance of the obstacle. The ranging results are shown in Table6, and the average time of the system is shown in Table 7.Table 6
Ranging results of four matching algorithms.
Actual distance (mm)SIFT algorithmSURF algorithmFAST algorithmAlgorithm in the research10001012.91011.81021.51009.711001115.41114.21126.21112.512001219.51218.11230.11216.913001322.31321.21333.21319.614001426.31425.71437.91423.515001531.61530.11542.81527.216001637.11636.51648.71630.917001746.11747.81752.61734.518001852.41853.91862.21839.119001968.61969.21979.51943.520002096.22097.52115.82046.921002211.52212.42254.92149.8Table 7
Average system time.
NameTime-consuming (s)Stereo matching module0.256Obstacle-type detection module0.096Obstacle identification system0.466As can be seen from Table7, the conceptual algorithm is much more accurate compared with the local problems based on SIFT, SURF, and FAST algorithms. As the distance increases, the data edge interference starts to decrease when the impact distance exceeds 1600 mm. The number of similar points is reduced by improving the SURF algorithm. However, the difference in reality has not changed much, and the energy is very strong. As can be seen from Table 7, the total time consumption and the impact experience of each part are in milliseconds, which can be satisfied in real time.


## 6. Conclusion

The main work of the research is as follows:(1)
Construction of Obstacle Visual Recognition System. By investigating the principle and mathematical model of binocular vision system, combined with the application environment of the system, the software and hardware platforms of the system were built. On the basis of analyzing the general steps of the realization of binocular vision system, the workflow of the system was designed. In the hardware design, the CCD camera with high imaging quality and strong anti-interference ability was used as the image acquisition equipment. The computer with high configuration was used as the image processing equipment to ensure the real-time image processing. In the software design, the development platform and the key technology required for image processing were mainly introduced. To facilitate the later transplantation, the research mainly adopted the open-source function library OpenCV 3.3.0 as the tool of image acquisition and processing and finally pointed out the parameters that may affect the system ranging accuracy.(2)
Calibration and Correction of Binocular Vision System. By investigating the main camera calibration methods and comparing their advantages and disadvantages, Zhang Zhengyou’s checkerboard calibration method was selected as the binocular calibration method in the research. By comparing the advantages and disadvantages of OpenCV and MATLAB calibration, MATLAB calibration toolbox was selected for calibration. Since focal length F may be affected by calibration distance and calibration plate specification, the control variable method was introduced to investigate calibration plates with different calibration distance and specification. Experiment verification showed that when the calibration plate size was 26 mm × 26 mm and the calibration distance was 1300 mm, the calibration average error was minimum and the optimal parameters—focal length f and internal and external parameters of left and right cameras—were obtained. Finally, the Bouguet algorithm based on OpenCV was used to complete stereo correction of left and right image pairs, so that the image plane was parallel and the row was aligned, which laid a foundation for improving stereo matching algorithm.(3)
Research on Obstacle Detection and System Experiment. Since the traditional object detection algorithm had the problems of few object detection types, low accuracy, and high time complexity, the YOLO convolutional neural network based on deep learning was introduced to improve the detection types and accuracy of obstacles. YOLO convolutional neural networks were adopted, which could realize real-time detection of the obstacles. The image area where the obstacle was located was framed. With the help of left and right stereo matching algorithm, feature points matching and parallax calculation were carried out. Finally, by using the triangulation principle, the distance between the obstacles was calculated and obstacle categories and distance detection were realized. The system had strong expansibility, which could be trained according to the actual needs of their own sample data set, so as to apply to different scenarios. By comparing and evaluating the research results of existing targets and discovery plans on the basis of in-depth research, the YOLO convolutional experimental results show that the problem discovery-level vision module based on the YOLO convolutional neural network can complete the real-time detection and quality of problems. Performance: the vision platform was built to identify the accuracy of various interfaces and propose the real-time performance of vision algorithms. The experimental results show that based on the combination of optical technology and YOLO convolutional neural network, the detection of group problems and distances can be realized within the range of 2100 mm, and the error position is within 5 mm. The overall algorithm took less than 500 ms, which could meet the requirements of the system.



---

*Source: 9022038-2022-08-18.xml*