/SDC-FindingLaneLines

This project uses a basic computer vision techniques and OpenCV in Python to detect lane lines.

Primary LanguageJupyter NotebookMIT LicenseMIT

SDC-FindingLaneLines

Finding Lane Lines on the Road

Udacity - Self-Driving Car NanoDegree

Combined Image

Overview


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

image1


Reflection

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.

  1. Convert RGB image to HLS color space
    image1

  2. Create white and yellow color masking of the original RGB image
    image1

  3. Convert white and yellow masking image to Grayscale color
    image1

  4. Smooth out the Grayscale image using Gaussian
    image1

  5. Use Canny edge detection function to detect edges of the image
    image1

  6. Create region of interest
    image1
    image1

  7. Use Hough tranform function to locate lines
    image1

  8. Use average function to calculate averaged slope and intercept of each lines and classify lanes as left or right

  9. Draw new averaged lines on the image
    image1

  10. Combined line image with original RGB image
    image1

2. Identify potential shortcomings with your current pipeline

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.

3. Suggest possible improvements to your pipeline

To make this more robust we can introduce a higher degree curve that will be useful on curved road.