On the Image Sensor Processing for Lane Detection and Control in Vehicle Lane Keeping Systems

Lane keeping systems for a keeping a vehicle in the desired lane is key to advanced driving assistance system in autonomous vehicles. This paper presents a cost-effective image sensor with efficient processing algorithm for lane detection and lane control applications to autonomous delivery systems. The algorithm includes (1) lane detection by inverse perspective mapping and random sample consensus parabola fitting and (2) lane control by pure pursuit steering controller and classical proportional integral speed controller based on a nonholonomic kinematic model. The image sensor experiments conducted on a 1/10 scale model car maneuvering in a straight–curve–straight lane validate the better processing performance before, during, and after the turning section over previous work. The image sensor with the processing algorithm achieves the average lane detection error within 5% and maximum cross-track error within 9% in real-time. The development shall pave the way to cost-effective autonomous delivery systems.


Introduction
It is known that the vast majority of all reported road accidents are due to human faults [1]. Advanced Driving Assistance System (ADAS) has recently been proposed to predict driver's intent, warn the driver about possible lane departure, and assist lane keeping [2], and it has been implemented on several vehicles in automobile industry. The reference path and the vehicle position can be determined from the maps created by geographic information system (GIS); however, the path and position accuracy often suffers from map resolution, data availability, and real-time update limitations. An on-board vision-based lane keeping system is therefore necessary to generate a reference path, obtain accurate vehicle position relative to the lane, and control the vehicle safely in a desired path.
A recent review summarized most vision-based lane detection methods that share three common steps [3]: (1) bird's eye view transformation by inverse perspective mapping [4,5], (2) lane feature detection by edge-based [6][7][8] or color-based methods [9], and (3) lane fitting by random sample consensus (RANSAC) combined with least-square line [10], B-spline [11], or hyperbola pair fitting [12] methods. Edge-based methods only rely on intensity information, thus require less computation for real-time applications, which proved to be key to cost-effective, autonomous vehicles in goods delivery. Lane fitting by the random sample consensus combined with parabola pair is considered the most applicable. Lane controllers can be designed based on nonholonomic kinematic or dynamic models. A proportional-integral-derivative (PID) steering controller [13] and a pure pursuit steering controller [14,15] have been proposed to determine vehicle steering angle to maintain safe driving in a lane. The above studies require on-board LIDAR (Light Detection and Ranging) with heavy computation load for lane keeping and radar for adaptive lane control.
In addition to chauffeuring people, another major function for autonomous vehicles is the delivery of goods. It is expected that 80% of all packages will be delivered autonomously in the next decade [16].
The world's e-commerce, in particular in USA and China, has doubled in the past 10 years and is expected to double again in the next five [17]. A cost-effective lane keeping system is therefore key to the development of autonomous delivery systems. This work proposes a lane keeping system for both lane detection and lane control by using only a low-cost image sensor (dashcam) with an efficient processing algorithm for real-time applications. In lane detection, inverse perspective mapping (IPM) followed by edge-based detection and RANSAC parabola fitting are applied to obtain accurate vehicle position relative to the lane center. In lane control, both pure pursuit steering controller based on a nonholonomic kinematic model and proportional-integral speed controller are adopted to maintain the vehicle safely in a desired lane. The image sensor with the processing algorithm is shown to be effective for both lane detection and lane control. The on-board processing time of the algorithm is more efficient than that of the previous work. With the advent of unmanned autonomous vehicles in the delivery market, this work may be one of the latest steps for applications to lower delivery costs of everyday items.

Lane Detection by Image Sensor
The vision-based lane detection is in three common steps: (1) image transformation from the sensor's frontal view to bird's eye view, (2) edge-based lane feature detection, and (3) lane markers regeneration or reconstruction in the processing image. In lane detection, the sensor image from a dashcam first has to be transformed from frontal view into bird's eye view so that the lane markings on become parallel (assuming constant lane width) for accurate vehicle positioning. Consider the image sensor with camera frame (X c , Y c , Z c ) mounted with pitch angle α, yaw angle θ, offset R x , R y on a vehicle in the world frame (X w , Y w , Z w ) at height h above the ground, as shown in Figure 1a. The transformation from an arbitrary point P w (x w , y w , −h) in the world frame to the corresponding point P i (u i , v i ) in the image plane as shown in Figure 1b can be determined by coordinate transformation: where ( f u , f v ) and (c u , c v ) are the focal length and the image sensor's optical center, respectively, and d = x w cosα sinθ + y w cosα cosθ + h sinα. The inverse perspective mapping from the image plane to the ground plane can be obtained by where In addition to chauffeuring people, another major function for autonomous vehicles is the delivery of goods. It is expected that 80% of all packages will be delivered autonomously in the next decade [16].
The world's e-commerce, in particular in USA and China, has doubled in the past 10 years and is expected to double again in the next five [17]. A cost-effective lane keeping system is therefore key to the development of autonomous delivery systems. This work proposes a lane keeping system for both lane detection and lane control by using only a low-cost image sensor (dashcam) with an efficient processing algorithm for real-time applications. In lane detection, inverse perspective mapping (IPM) followed by edge-based detection and RANSAC parabola fitting are applied to obtain accurate vehicle position relative to the lane center. In lane control, both pure pursuit steering controller based on a nonholonomic kinematic model and proportional-integral speed controller are adopted to maintain the vehicle safely in a desired lane. The image sensor with the processing algorithm is shown to be effective for both lane detection and lane control. The on-board processing time of the algorithm is more efficient than that of the previous work. With the advent of unmanned autonomous vehicles in the delivery market, this work may be one of the latest steps for applications to lower delivery costs of everyday items.

Lane Detection by Image Sensor
The vision-based lane detection is in three common steps: (1) image transformation from the sensor's frontal view to bird's eye view, (2) edge-based lane feature detection, and (3) lane markers regeneration or reconstruction in the processing image. In lane detection, the sensor image from a dashcam first has to be transformed from frontal view into bird's eye view so that the lane markings on become parallel (assuming constant lane width) for accurate vehicle positioning. Consider the image sensor with camera frame ( , , ) mounted with pitch angle , yaw angle , offset , on a vehicle in the world frame ( , , ) at height h above the ground, as shown in where ( , ) and ( , ) are the focal length and the image sensor's optical center, respectively, and = + + ℎ . The inverse perspective mapping from the image   Figure 2b, and they can be applied to locate the lane position by edge-based lane feature detection. The intensity difference between the lane markings and the ground pavement is often so strong that the IPM image can be converted to binary grayscale image and then filtered by an intensity threshold q: where k is a constant to preserve lane markings, M(I) is the peak with the highest intensity value in the histogram of the grayscale image, and I is the grayscale image. Figure where k is a constant to preserve lane markings, ( ) is the peak with the highest intensity value in the histogram of the grayscale image, and is the grayscale image. Figure Figure 2a illustrates the inverse perspective mapping where the sensor image is transformed by inverse perspective mapping (IPM) into a bird's eye view image. After IPM, the lane features such as intensity and geometry of the lane markings are preserved as shown in Figure 2b, and they can be applied to locate the lane position by edge-based lane feature detection. The intensity difference between the lane markings and the ground pavement is often so strong that the IPM image can be converted to binary grayscale image and then filtered by an intensity threshold q: where k is a constant to preserve lane markings, ( ) is the peak with the highest intensity value in the histogram of the grayscale image, and is the grayscale image. Figure   Note that the lane markings close to the vehicle are approximately vertical after the transformation, thus the horizontal position of the left and right lane marking can be determined by the column intensity sum of the threshold image, and two lines L L and L R passing through x L and x R , respectively, are the initial guess of the position of the left and right lane marking. Their slope can be determined by the two windows of width w/2 and height b at horizontal position as shown in Figure 4a. By the intensity center of each of the two windows, the slope of L L and L R can be determined as indicated in Figure 4b.   One of the major challenges in autonomous delivery vehicle is lane detection when making sharp turn. In order to obtain a better position estimate in curve lane markings, random sample consensus (RANSAC) parabola fitting is applied around and for lane feature detection. The parabola fitting is to divide each window into sections equally spaced in the y-direction, as shown in Figure 4c, select randomly one point from each section to define parabola geometry by the least square method, and calculate the accumulated intensity value of the parabola. By use of the central One of the major challenges in autonomous delivery vehicle is lane detection when making sharp turn. In order to obtain a better position estimate in curve lane markings, random sample consensus (RANSAC) parabola fitting is applied around L L and L R for lane feature detection. The parabola fitting is to divide each window into sections equally spaced in the y-direction, as shown in Figure 4c, select randomly one point from each section to define parabola geometry by the least square method, and calculate the accumulated intensity value of the parabola. By use of the central limit theorem, a parabola can be estimated accurately as shown in Figure 4d

Lane Control by Image Sensor
A pure pursuit steering controller and a PI speed controller were applied to keep the vehicle driving safely along the detected lane center at a desired velocity. The former controller calculates a kinematically feasible path for vehicle to maneuver from its current position to goal position. This is used for most vehicles with no universal wheels installed. The latter controller allows the vehicle to follow the calculated curve path, and classical PI control was adopted for acceptable control performance with low or no computation loading. The graphical description of a pure pursuit controller based on a nonholonomic kinematic model [18] is shown in Figure 5, where L is the vehicle wheelbase, l is the distance from the rear axle to the forward anchor point defined as the center of the vehicle, L f is the forward drive look-ahead distance, and η is the heading of the look-ahead point (constrained to the reference path) from the forward anchor point with respect to the vehicle heading. In steering control, the steering angle δ can be determined by δ = tan −1 (L/R), where R is the distance from the instantaneous rotation center O to the rear axle, R = L f /2 + lcos(η )/sin(η). The forward drive look-ahead distance L f is dependent on the command velocity for stability. Under high velocity conditions, larger L f is required in order to maintain the system stability and determine a more feasible δ for the nonholonomic kinematic model. In speed control, a classical PI controller was adopted without the derivative (D) term for closed loop system stability: where u is the nondimensional speed control signal, K p and K i are the proportional and integral gains, respectively, r is the command velocity, and s is the vehicle velocity. The time step dτ ∼ = ∆t is identified according to the update rate of the state of the vehicle and the computational speed. The proportional and integral gains K p and K i can be determined by extensive testing guided by the parameter space approach of robust control. By applying the parameter space approach, an area in the K p − K i plane can be determined for which the desired design specifications such as stability, phase margin limitation, and robustness are satisfied. Through actual experiment, the PI controller parameters best fit all the design specifications are then determined.

Lane Control by Image Sensor
A pure pursuit steering controller and a PI speed controller were applied to keep the vehicle driving safely along the detected lane center at a desired velocity. The former controller calculates a kinematically feasible path for vehicle to maneuver from its current position to goal position. This is used for most vehicles with no universal wheels installed. The latter controller allows the vehicle to follow the calculated curve path, and classical PI control was adopted for acceptable control performance with low or no computation loading. The graphical description of a pure pursuit controller based on a nonholonomic kinematic model [18] is shown in Figure 5, where L is the vehicle wheelbase, l is the distance from the rear axle to the forward anchor point defined as the center of the vehicle, is the forward drive look-ahead distance, and is the heading of the look-ahead point (constrained to the reference path) from the forward anchor point with respect to the vehicle heading. In steering control, the steering angle can be determined by = ( / ), where R is the distance from the instantaneous rotation center O to the rear axle, = ( /2 + ( ))/ ( ). The forward drive look-ahead distance is dependent on the command velocity for stability. Under high velocity conditions, larger is required in order to maintain the system stability and determine a more feasible for the nonholonomic kinematic model. In speed control, a classical PI controller was adopted without the derivative (D) term for closed loop system stability:

Experimental Verification
The performance of the image sensor processing algorithm in lane keeping system is verified by a 1/10 scale model car of length 40 cm and width 18 cm maneuvering in straight-curve-straight lane as shown in Figure 6. The car is equipped with an image sensor (fisheye dashcam), inertial measurement unit, and on-board computer (ARM, 2 GHz). The trajectory of the car during experiment is captured by an overhead camera with 90 • field of view (FOV), 24 frames per second (fps), and 800 × 600 pixel resolution to observe the cross-track error.
is identified according to the update rate of the state of the vehicle and the computational speed. The proportional and integral gains and can be determined by extensive testing guided by the parameter space approach of robust control. By applying the parameter space approach, an area in the − plane can be determined for which the desired design specifications such as stability, phase margin limitation, and robustness are satisfied. Through actual experiment, the PI controller parameters best fit all the design specifications are then determined.

Experimental Verification
The performance of the image sensor processing algorithm in lane keeping system is verified by a 1/10 scale model car of length 40 cm and width 18 cm maneuvering in straight-curve-straight lane as shown in Figure 6. The car is equipped with an image sensor (fisheye dashcam), inertial measurement unit, and on-board computer (ARM, 2 GHz). The trajectory of the car during experiment is captured by an overhead camera with 90 ∘ field of view (FOV), 24 frames per second (fps), and 800 × 600 pixel resolution to observe the cross-track error.  Figure 2a. The image in ROI is then transformed to the bird's eye view image (300 × 400 pixel) and converted to grayscale as shown in Figure 2b. The intensity histogram of the grayscale IPM image is calculated with the peak marking the highest intensity ( ) as shown in Figure 3a.
According to the testing results, = 0.9 is adopted to obtain the best filtering performance by Equation (5). The column intensity sum of the binary image can then be applied to locate the horizontal position and of the left and right lane marking and the lane width as shown in Figure 3b and 3c. With the two windows of width /2 and height 60 pixels at the bottom of each of the two lane markings as shown in Figure 4a, the slope of each lane marking can be determined as shown in Figure 4b. These slopes are applied to obtain two windows of equal width for spline fitting  Figure 2a. The image in ROI is then transformed to the bird's eye view image (300 × 400 pixel) and converted to grayscale as shown in Figure 2b. The intensity histogram of the grayscale IPM image is calculated with the peak marking the highest intensity M(I) as shown in Figure 3a. According to the testing results, k = 0.9 is adopted to obtain the best filtering performance by Equation (5). The column intensity sum of the binary image can then be applied to locate the horizontal position x L and x R of the left and right lane marking and the lane width w as shown in Figure 3b,c. With the two windows of width w/2 and height 60 pixels at the bottom of each of the two lane markings as shown in Figure 4a, the slope of each lane marking can be determined as shown in Figure 4b. These slopes are applied to obtain two windows of equal width for spline fitting as shown in Figure 4c. Each window is divided into 10 sections and the number of iterations of the spline fitting is set of 30 to obtain the best performance on the on-board computer, as shown in Figure 4d. Based on the parallel lane model, the lane center can therefore be obtained. The efficiency of the lane detection algorithm is shown in Figure 7a. In a series of 300 captured images of a typical maneuver in a straight lane, the computation time in lane detection by the on-board CPU (2 GHz) is in the range of 10.4 to 11.2 ms. By comparison, the computation time by using the method in [6] is 11.5 to 12.2 ms. The algorithm in this work is shown more efficient in all of the 300 images in lane detection. In addition, the algorithm remains applicable to curve lane, while the method in [6] is otherwise for its limitation when using Hough transform. Figure 7b illustrates the accumulated time of processing the 300 images during vehicle motion of~10 s. The algorithm is shown to shave 0.5 s of computation time in lane detection, and such saving is critical to the development of autonomous delivery systems.
spline fitting is set of 30 to obtain the best performance on the on-board computer, as shown in Figure  4d. Based on the parallel lane model, the lane center can therefore be obtained.
The efficiency of the lane detection algorithm is shown in Figure 7a. In a series of 300 captured images of a typical maneuver in a straight lane, the computation time in lane detection by the onboard CPU (2 GHz) is in the range of 10.4 to 11.2 ms. By comparison, the computation time by using the method in [6] is 11.5 to 12.2 ms. The algorithm in this work is shown more efficient in all of the 300 images in lane detection. In addition, the algorithm remains applicable to curve lane, while the method in [6] is otherwise for its limitation when using Hough transform. Figure 7b illustrates the accumulated time of processing the 300 images during vehicle motion of ~10 s. The algorithm is shown to shave 0.5 s of computation time in lane detection, and such saving is critical to the development of autonomous delivery systems. The lane control experiment is also performed on the 1/10 scale model car. For the pure pursuit controller, the vehicle wheel base is L = 26 cm and the distance from the rear axle to the forward anchor point is l = 6 cm. The forward drive look-ahead distance L f is dependent upon the command velocity r to overcome the stability issue. According to the characteristics of the nonholonomic kinematic model, the relationship between L f and r in the experiment is For speed control, the PI controller parameters K p and K i are determined through the parameter space by experiment: K p = 0.3 and K i = 0.04. For the integration, the time step is set at 5 ms to achieve the best performance.
The      inertial measurement unit, and on-board computer (ARM, 2GHz). The efficiency of the lane detection algorithm is~11 ms for lane detection of a typical image, which is~5-10% lower than that in comparable study [6]. The algorithm in this work is shown more efficient in all of the 300 images in lane detection. In addition, the algorithm remains applicable to curve lane. In lane control, the trajectory of the car during experiment is captured by an overhead camera to observe the cross-track error. Experiments conducted on the model car maneuvering at speed 1 m/s in a curve lane of radius 99 cm for~G acceleration further show that that the average lane detection error before, during, and after curve lane are all within 5%. The image sensor with the processing algorithm is effective in advanced driving assistance of autonomous delivery systems. In lane control, a pure pursuit steering controller and a proportional integral speed controller based on a nonholonomic kinematic model are applied to show that the maximum cross-track error is within 9% in lane control. Both the lane detection and lane control performance are critical to the development of autonomous delivery systems. (3) The proposed lane keeping system is considered effective and efficient. Future development will simulate more complicated road conditions such as rugged ground and light conditions, such as glare when facing the sun and dim light when driving in a tunnel. Rugged ground may cause the vehicle to tilt, thus changing the yaw and pitch angle of the vehicle, and affecting the accuracy of inverse perspective mapping. Glare and dim light conditions may reduce the intensity difference between the lane markings and the road pavement, so that detecting lane features using the edge-based method may therefore be challenging.

Conclusions
Author Contributions: C.Y.K. and Y.R.L. conducted the experimental verifications in their joined capstone project, and S.M.Y. provided the algorithm development and oversaw the project progress.
Funding: Kuo and Lu are grateful to the summer research grants from the Ministry of Science and Technology of Taiwan government.

Conflicts of Interest:
The authors declare no conflict of interest.