Finding Lane Lines on the Road
Results:
My pipeline consisted of 9 steps.
-
First Blur, this is especially important for the challenge video (the part with shadows). Also for getting ride of noise, before enhancing contrast
-
Minor Contrast increase for better detection if lighting is bad
-
Boost Yellow and White by converting to HSV and applying mask. Then combine with the incoming image
-
Second Blur, getting rid of noise (not necessarily necessary)
-
First Determine all lines with Hough Transformation, then calculate slope, y0 and length of every line.
- Then classify them into left and right, according to the slope (positive or negative).
- At the same time check against min and max slope, if not in this range, ignore line.
- After this, calculate average slope and y0 with weighting in the length, to make longer lines more dominant.
- Then calculate the slope and y0 with moving average over variable number of frames (I chose 4 frames) to smooth.
- Store this information (slope, yo) in array for next frame for calculating moving average or if no lines are detected.
- Calculate the four points for the two lines (1 right, 1 left), format the output in the way, that different coloring is possible
-
Draw the two lines on original image, choose red for not detected and green for detected line
Shortcomings: - the minimal and maximal slope of a line is set, so hard curves are not possible - this pipeline is pretty computationally intensive, it takes some time. So it has possibly not real-time capability - in the challenge video the shadow and the light colored bridge are very difficult, accuracy is not very high
Improvements: - instead of plotting a straight line, you can polyfit to the data points and make curves more accurate - Don't grayscale and blur a second time to save computing time - the challenge video was not accurate