When we drive, we use our eyes to decide where to go. The lines on the road that show us where the lanes are act as our constant reference for where to steer the vehicle. Naturally, one of the first things we would like to do in developing a self-driving car is to automatically detect lane lines using an algorithm.
In this project you will detect lane lines in images using Python and OpenCV. OpenCV means "Open-Source Computer Vision", which is a package that has many useful tools for analyzing images.
To complete the project, two files will be submitted: a file containing project code and a file containing a brief write up explaining your solution. We have included template files to be used both for the code and the writeup.The code file is called P1.ipynb and the writeup template is writeup_template.md
To meet specifications in the project, take a look at the requirements in the project rubric
- Convert the image to gray scale
- Apply Gaussian Blur
- Apply canny edge detection
- Cut out the ROI
- Lines detection using Hough algorithm
- Select lines with reasonable slope and draw on image
- Filter out all lines that are not with a slope within 20 to 90 degree or -20 to -90 degree.
- A line with a slope within 20 to 90 degree goes to the right line group, one within -20 to -90 go to the left group.
- Average the starting points and ending points in each of the right and left group, and calculate the slope according to the averaged points.
- Draw line with the information of the slope and an averaged point, for both left and right.
If it's really bright on the road, like a segment in the challenge vedio, it's then really hard to detect yellow lines' edges, which would lead to a total failure of finding lane lines. So there would be something to improve, like using another color system like HSV, with which is convinient to filter out the irrelevant colors and only let white and yellow stay.