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
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.
This project is divided into 4 categories. First, color selection, second, canny edge detection, third, determining region of interest, and forth, hough transform for detecting lines.
My pipeline consisted of 10 steps.
-
Create white and yellow color masking of the original RGB image
-
Use Canny edge detection function to detect edges of the image
-
Use average function to calculate averaged slope and intercept of each lines and classify lanes as left or right
The current pipeline can only detect lanes which are straight. For the parameters of the canny edge and hough functions, trial-and-error method was used to obtain desired results. Also Region of Interest assumes that camera stays at same location and lanes are flat. So there was some assumtions work involved and hard coding in deciding polygon vertices.
In general, there are many roads which might not be with lane markings and this pipeline is not robust enough work in different weather conditions (eg. snowing, cloudy, raining, etc.) where this won’t work.
To make this more robust we can introduce a higher degree curve that will be useful on curved road.