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 5 steps.
- Converted the images to grayscale
- Used gaussian blur to blur the image
- Find edges using canny edge detector
- Mask only the area that will have the lane mark
- Transform to hough space to find lines
In order to draw a single line on the left and right lanes, I modified the draw_lines() function with this method.
- Use (x1-x2) * (y1-y2) to tell if a line is left or right lane
- Keep the longest lines for both left and right lane
- Use the lane from last frame to calculate the new lane, so that it's more stable
To complete the challenge, here are my modification to draw_lines()
- Used angle to filter out lines, only keep lines with a slope between 0.5 and 2.0
- Instead of keeping the longest line, I calculated the average starting point end ending point of all lines
- Extended line until it touches the bottom of the screen
One potential shortcoming would be what would happen when the car direction change rapidly, because the lane tracking algorithm relies on previous frame data.
Another shortcoming is that it couldn't handle corner very well because it assumes that lane line are straight.
A possible improvement would be to use a line finding algorithm that support detecting curve to replace hough.
Another potential improvement could be to make use of the color of the road.