# Research on Lane Detection Based on Global Search of Dynamic Region of Interest (DROI)
## 3 Design of Dynamic Region of Interest (DROI) Based on Security Vision  
### Longitudinal Boundary Design of DROI Based on Safe Car Distance  
In order to obtain a better ROI, in this paper, the concept of safety vision is introduced based on road traffic safety rules. Therefore, according to the adaptive security field of view, the DROI will be selected.  
Generally, the field of vision comes from the front of the vehicle. In accordance with the focus of imitating human habits, this section restricts the longitudinal range of DROI to the safe distance.  
The safety area of the front view refers to the distance when the car brakes in an emergency. If the speed of the vehicle is too high, the lane line vanishing point will be the longitudinal dynamic region of the interest boundary. Meanwhile, in order to ensure safety on roads with excessive curvatures, the speed must be less than the critical speed of rollover.  
Since the lane line detection is aimed at matching the lane line equations in the pixel coordinate system, the image coordinate system must be converted into the geodetic coordinate system to find the longitudinal safe distance of vehicles. Firstly, the displacement ratio of the image coordinate system to the geodetic coordinate system is calibrated. Next, in the image coordinate system, the horizontal and longitudinal displacements of the lane are expressed in pixel coordinates. The minimum units are a row and a column. In the actual process, the displacement is described by m, so the difference between the two coordinate systems must be calibrated after the aerial view transformation [14]. The ratios of horizontal and vertical distances, between an image coordinate system and a geodetic coordinate system, are \(a_{x}\) and \(a_{y}\) respectively; they are given by:  
\[a_{x}=\frac{l}{m}\;, \tag{9}\]  
\[a_{y}=\frac{s}{n}\;, \tag{10}\]  
where m denotes the value of the row in the pixel coordinates, 1 is the actual distance in the geodetic coordinates, \(n\) represents the value of the column, and s indicates the value of the realistic length in the geodetic coordinates.  
The aggregation equations of the feature points in the left and right lane line image are given below.  
\[y_{l}=f_{l}(x_{l}) \tag{11}\]  
\[y_{r}=f_{r}(x_{r}) \tag{12}\]  
Figure 4: Image comparison before and after affine transformation: (**a**) Original gray image; (**b**) Affine transformation image.  
The aggregation equations of the left and right lane line points represented in the geodetic coordinate are shown in Equation (13):  
\[\left\{\begin{array}{l}\hat{x}_{l}=x_{l}\times a_{x}=x_{l}\times\frac{l}{m}\\ \hat{y}_{l}=y_{l}\times a_{y}=y_{l}\times\frac{s}{n}\end{array}\right\{\begin{array}[ ]{l}\hat{x}_{r}=x_{r}\times a_{x}=x_{r}\times\frac{l}{m}\\ \hat{y}_{r}=y_{r}\times a_{y}=y_{r}\times\frac{s}{n}\end{array}\right. \tag{13}\]  
The curvature equation in the rectangular coordinate system is as follows:  
\[\rho=\frac{1}{r}=\frac{\left(1+{y^{\prime}}^{2}\right)^{\frac{3}{2}}}{\left|{ y^{\prime\prime}}\right|} \tag{14}\]  
The radius of curvature of lane lines is calculated by the radius of curvature equation:  
\[r=\frac{1}{\rho} \tag{15}\]  
The slope at a certain point of the lane line is shown below:  
\[y^{\prime}=tan\beta \tag{16}\]  
\(v_{c}\) can be calculated by the following inverse trig function:  
\[v_{c}=v_{r}sin\beta\, \tag{17}\]  
where \(\beta\) is the inclination angle of the tangent line at each point under the track of the lane line, \(v_{c}\) is the longitudinal speed of the lane line, and \(v_{r}\) is the vehicle speed at the current frame.  
The empirical formula between speed and brake distance is as follows [22]:  
\[y_{p}=f(v_{c})=\frac{1}{30\times 0.348}{v_{c}}^{2}+3.675v_{c} \tag{18}\]  
Now, according to the relationship between the actual displacement and the image pixel, the boundary of the left and right lane lines in the image can be determined.