# Research on Lane Detection Based on Global Search of Dynamic Region of Interest (DROI)
## 4 Lane Detection and Tracking
### Lane Line Fitting Based on a Polar Coordinate System  
After completing the above steps, the data feature points of the lane lines are available. In this section, the data sets of the left and right lane lines are established, and then the lane line coordinates are estimated by establishing the mathematical model. A great deal of research has been undertaken on lane line models in the literature. Existing lane line models mainly include the parabolic, linear, hyperbolic, B spline curve and mathematical models of other functions. However, these models are built based on the rectangular coordinate system, and one characteristic of rectangular coordinates is that a given independent variable corresponds to a given dependent variable. In addition, an infinitely sloping lane line cannot be fitted by the equation. In order to solve these problems, the feature points of the lane line are fitted using the polar coordinate system, yielding superior results to those reported using traditional methods. The shape of the lane line in the image coordinate system is divided into two kinds of straight line and curve. In a Cartesian coordinate system, a given x-coordinate will have multiple values corresponding to the y-coordinate when the lane line is perpendicular to the X-axis. This would violate the definition of linear function, and the lane line could not be represented by the function. To solve this problem, a novel method based on the polar coordinate system is proposed. In this method, the data of the lane line can be fitted by the function \(\rho=f(\alpha)\). The conditions for the reciprocal transformation of the polar coordinate system and rectangular coordinate system are as follows:  
1. \(\rho\geq 0,\alpha\in[0,\pi)\). 2. The poles of the polar coordinate system coincide with the origin of the rectangular coordinate system. 3. The polar axis overlaps with the x axis of the rectangular coordinate system. 4. Both coordinate systems have the same unit length. According to Figure 11, the angle of the lane line in the polar coordinate system varies from 0 to \(\pi\). If the remaining conditions are met, the transformation from the rectangular coordinate system to polar coordinate system can be fulfilled. During lane line fitting, the lane should be divided into straight line fitting and curve line fitting. Additionally, before the ROI is obtained, the differential coefficient should be solved. Based on Equation (26), the feature point (x, y) in the rectangular coordinate system can be transferred to point \((\alpha,\rho)\) in the polar coordinate system. Finally, the lane line feature points are fitted by the least square method in the polar coordinate system. The coordinate transformation relationship is as follows:  
\[\left\{ \begin{array}{l}x=\rho\cos\alpha\\ y=\rho\sin\alpha\end{array} \right. \tag{36}\]  
Based on Equation (36), the following fitting equation can be obtained:  
\[\left\{ \begin{array}{l}\rho_{l}=f(\theta_{l})\\ \rho_{r}=f(\theta_{r})\end{array} \right. \tag{37}\]  
Additionally, according to Equations (14) and (23), the curvature formula can be achieved in the polar coordinate system:  
\[\mathrm{K}=\left\lfloor\frac{2{{\rho^{\prime}}^{2}}(\theta)+{\rho}^{2}(\theta )-\rho(\theta){\rho^{\prime\prime}}(\theta)}{\left({\rho}^{2}(\theta)+{\rho^{ \prime}}^{2}(\theta)\right)^{\frac{3}{2}}}\right\rfloor \tag{38}\]  
Figure 11: Polar and rectangular coordinates: (**a**) Rectangular coordinates; (**b**) Polar coordinates.