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.
The pipeline created for this project consists of the following steps
- Convert the RGB input image to grayscale
- Apply Gaussian blur to the grayscale image
- Apply Canny edge detection
- Masking off of a region of interest
- Applying a Hough transform to identify the line segments
- Filtering out line segments that are not likely to be part of lane lines due to their slope
- Averaging the slope and intercept of the candidate lines to calculate the position and slope of the drawn lane lines
In order to draw a single line on the left and right lanes, the drawlines() function was modified to always draw a continuous line from the bottom of the image to the top of the region of interest. The input parameters were the X intercept of this continuous line an its corresponding slope.
2. Identify potential shortcomings with your current pipeline
The idea of filtering the angle of the detected segments could face difficultly in the case that the road is winding. It seems to perform reasonably well on this relatively straight highway driving. Possibly this is a contributing factor to why standard ADAS lane assist can only be used in certain situations?
Color variations in the road and lines also seemed to effect the lane detection to some extent as well. When no good line was detected, I elected to drop the displayed lane line. Although it only happed for a couple frames in the challenge, this is obviously not and acceptable solution.
Additionally, the out lane detection showed some jitter during operation. Depending on the overall control scheme, this could lead to an unpleasant riding experience.
3. Suggest possible improvements to your pipeline
A possible improvement would be to actually work with color detection, which, I could not get to work for me in this case. This would likely solve a significant amount of problems the detection of edges that are not part of the lane lines.
This would probably take me a bit of time but, it seems that a Kalman filter could be used to either:
- Predict where the lines should be based on previous computations and the trajectory of the vehicle.
- Adjust or tune the ROI based on previous observations (e.g. thresholds can be made more sensitive in the relevant region)
- Assuming only one line is seen, predict where the other should be and or adjust the ROI.
- Apply smoothing to the somewhat noisy line output.
Finally, the author can get better at Python to expedite the whole process.