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 consists of 5 steps.
First, I converted the image to grayscale because cv2.Canny() only takes 8 bit image as input.
Second, I applied guassian filter on the image to smooth any noise points.
Third, I applied canny function to find out all the edge in the picture.
Fourth, because lane lines will only appear in certain area, I masked the original image to find out only the edge of the lane line.
Fifth, in order to draw lines on the image, I used hough transform function to find out lines in the image.
Sixth, I combined the line image with original image.
In order to draw a single line on the left and right lanes, I modified the draw_lines() function.
I have learnt that a point and a slope can define a line. Also, I can use the sign of the slope to differentiate left and right lane. So firstly I compute the centre point and the average slope for left and right lane. After that, I can find the top and bottom points for both lanes by using the formula: (y - y') = M(x - x')

One potential shortcoming would be what would happen when there are other edges appearing on the road(such as cracks and curbs). This can mess up the centre point and the slope, causing the lane line marker to be in the wrong position.
Another shortcoming could be in my system, if there is no line detected in the image, it will not draw any line. This could be a safety problem in reality.
A possible improvement would be to use machine learning to learn which one is the lane line.