# Research on Map-SLAM Fusion Localization Algorithm for Unmanned Vehicle
## 2 Structured Representation of Lane Lines and Map Information  
### Lane Line Detection and Positioning  
To combine the detected lane information with the lane information in the map, it is necessary to structure the lane lines and the map information separately. In this paper, lane line detection is performed by [3], and the split-shuffle-bottleneck [21] mechanism is introduced to improve the detection speed. At the same time, a fixed-parameter perspective transformation matrix is used instead of the adaptive H-Net [22], which further improves the speed and accuracy. The obtained lane line detection result is a point set on the image plane. By projecting the point set to 3D homogeneous coordinates (\(x\), \(y\), 1), a straight line is fitted to obtain the lane line \(l_{1}l_{2}..l_{n}\), and the normal vector d between the lane line. The center is calculated, and the direction can be judged by the relative position of the exit lane line and the vehicle. The left and right lane lines \(l_{left}l_{right}\) are selected by the two nearest neighbors. To be able to combine with the data in the map, some key information corresponding to the two needs to be obtained. We make the road plane assumption, which is that the points of the lane line \(l_{left}l_{right}\) are in this plane. It means that the road is assumed to be a plane, or the vehicle. The short driving area is a flat surface, and the car runs smoothly on this road surface without leaning forward or backward at a large angle. Suppose that in the camera coordinate system, the road plane equation \(plane_{A}\) is:  
\[Ax+By+Cz+D=0 \tag{1}\]  
Figure 1: Algorithm flow diagram. According to the road plane assumption, when the vehicle is running smoothly, the relative position relationship between the camera and the road plane will not change, so the plane parameter \(ABCD\) can be obtained by calibration. \[\left\{ \begin{aligned} & f_{x}\cdot\frac{X_{C}}{Z_{C}}+u_{0}=u\\ & f_{y}\cdot\frac{Y_{C}}{Z_{C}}+v_{0}=v\\ & A\cdot X_{C}+B\cdot Y_{C}+C\cdot Z_{C}+D=0\end{aligned} \right. \tag{2}\]  
Among them, \(f_{x},f_{y},u_{0},v_{0}\) represent the pixel focal length and center offset in the camera internal parameters, and s represents the position scale of the monocular camera. The equations \(u,v\) and the camera internal parameters are all known, so only four sets of points are needed. \(X_{C},\ Y_{C},\ Z_{C}X_{C},\ Y_{C},Z_{C}\) can calculate the plane parameters, that is, the plane parameter results can be obtained by calibrating the known points a priori. After the plane equation is known, to obtain the true three-dimensional image lane line point \(P_{0}=[X_{C},Y_{C},Z_{C}]^{T}\), the description of \(P_{0}\) observed by the camera is:  
\[p_{0}=s\cdot K\cdot P_{0} \tag{3}\]  
\[K= \begin{bmatrix}f_{x}&0&u_{0}\\ 0&f_{y}&v_{0}\\ 0&0&1\end{bmatrix}  \tag{4}\]  
\[p_{0}=[u,v,1]^{T} \tag{5}\]  
Simplify to obtain camera constraints:  
\[\left\{ \begin{aligned} & f_{\times}\cdot\frac{X_{C}}{Z_{C}}+u_{0}=u\\ & f_{y}\cdot\frac{Y_{C}}{Z_{C}}+v_{0}=v\end{aligned} \right. \tag{6}\]  
Therefore, using the equation again, we can solve the true value of \(P_{0}=[X_{C},Y_{C},Z_{C}]^{T}\), and finally obtain the positioning result of each point of the lane line, so as to calculate the equation of \(l_{left}l_{right}\) in the camera coordinate system:  
\[l:\left\{ \begin{aligned} & AX+BY+CZ+D=0\\ & A_{1}X+B_{1}Y+C_{1}Z+D_{1}=0\end{aligned} \right\} \tag{7}\]  
Among them, the two planes are, respectively, denoted as the road surface plane \(plane_{A}\) and the plane perpendicular to the road surface \(plane_{B}\), which are obtained by the lane line 3D point coordinates \(P_{0}=[X_{C},Y_{C},Z_{C}]^{T}\). Therefore, the relative position relationship between the lane line and the vehicle can be calculated, including the absolute distance \(d_{lane}=d(plane_{B},(0,0,0))\) of the vehicle from the left and right lane lines, and the projection angle of the lane line:  
\[\theta_{lane}=\arcsin(\frac{d_{lane}}{d((0,0,0),P_{0})}) \tag{8}\]  
\[P_{O}=\left\{