Finding Lane Lines on the Road
The goals / steps of this project are the following:
- Make a pipeline that finds lane lines on the road
- Reflect on your work in a written report
1. Describe your pipeline. As part of the description, explain how you modified the draw_lines() function.
My pipeline consisted of 10 steps:
-
turn the image to grayscale
-
Gaussian blur the image to remove noise
-
detect the edges in the image using Cany edge detection
-
use polygon region to crop out the region of interest
-
use hough line extraction to extract lines from edge features
-
compute the slop of lines and cluster the lines by the sign of the slops
-
compute the average slop of each group (as smoothed slop)
-
compute a smoothed top point by average over line segment tops (threshold on y coordinate < 375)
-
use the smoothed top point and slop to infer the bottom point of each line
-
use draw_lines with thickness=5 and weighted_img to draw the extrapolated line on the image
In order to perform extrapolation, I implemented a new function extrapolate_lane()
in cell[6]: 40
the function is called in process_image cell[9]: 24
, after the hough line extraction
-
the original pipeline does not work well for challenge clip, for reasons:
a. the challenge video is in 720p resolution, does not match the 540p video in development
b. the challenge clip has a lot of textures and lightning condition vibration
c. the challenge clip has curved lane instead of straight one
-
my implementation in
optional_challenge.ipynb
address these problems by:a. normalize the clip to 540p to make all the pipeline parameter work as expected.
optional_challenge.ipynb cell[2]: 150
b. in slop clustering step, the positive group is taken as the lines with slop > 0.45; the negative group is taken as the lines with slop < -0.45; this update effectively removed all the noise textures.
optional_challenge.ipynb cell[2]: 100
-
these two updates fixed most of the problems in this challenge as illustrated in the video
-
One potential shortcoming would be the algorithm pipeline is tailored to straight line detection and straight line motion, it will fail in turning motion.
-
the algorithm is not robust w.r.t drastic lightning condition vibration; as illustrated by the bad cases in challenge clip, the left side is missing since the edge detector failed.
-
more robust edge detector that works in different lightning conditions (for example, HSV color scheme)
-
more sophisticated geometric object extraction to accommodate the cases in curved lane
-
single step sensor estimation can be improved by sequence state modeling; using sequence model (bayes filter or variational ones https://arxiv.org/abs/1605.06432) to filter the lane state could robustly remove the noise in one step sensor measurement