Finding Lane Lines on the Road
The goals of this project are the following:
- Make a pipeline that finds lane lines on the road under changing light conditions and different lane mark colors.
---
I divided my pipeline in 3 major steps. The first step is raw data processing. Second step is finding lanes in the preprocessed data and the last step is the visualisation of the data.
I converted the image into HSV color space to pick the yellow and white lanes easier.
After that i reduced the region of interest to the typical area where lanes can possibly be seen by the camera.
By applying a canny filter to the binary image of the lanes the image data is reduced to the edges only.
With the Hough transformation function I find possible lane candidates.
My next goal was to distinguish between right and left lanes. To make this decision i use the start and end point of each line which is detected by the Hough transformation and calculate the slope. Lines with negative slopes are possibly right lanes, lines with positive slope possibly left lanes. Until this point there are still several left and right lane candidates. To reduce all candidates down to one left and one right lane I take all start and end points of the "left" Hough lines/lanes and use the polyfit function (degree 1 in this simple case). The same approach is used for the right lines. After this I have one defined right lane and a defined left lane. In case no lanes are detected at all I added exeption handling in this step so the program continues in any case.
Both Lanes are finally combined with the original image to show the most likely course of the lanes.
My pipeline is also able to detect the lanes of the challenge video. At least most of the time. To achieve this, I had to change the hard coded ROI to an image size independent ROI and changed the color picker function to HSV colormap as well.
-
Big changes in the lighting conditions could lead to problems since the color picking approach depends on hard coded color values. The light conditions during cloudy weather or twilight are not shown in any of the test videos.
-
Each frame is handled individually. Jumps of the detected lanes due to misinterpretation are easily possible.
-
The use of histogramm equation could help to handle different lighting conditions.
-
Since one can assume that there are no sudden changes if the lane slope on a normal road one could create a integral element / buffer where the slope of the previous 1 or 2 frames is averaged with the current one. Big jumps of the detected lane caused by misinterpretation could be avoided or at least the effect could be watered down.