/finding-lane-lines

Finding Lane Lines: Project for Udacity Self-Driving Car Nanodegree

Primary LanguageJupyter NotebookMIT LicenseMIT

Finding lane lines

Project 1 for Udacity Self-Driving Car Nanodegree

This is a project I created for the Udacity Self-Driving Car Engineer Nanodegree. The goal was to build a pipeline of image processing functions that takes a road image / video as input and outputs the image / video with lane lines marked with straight red lines.

The entire code is available in this repository in a Jupyter notebook which includes code to test the pipeline with an image and a video. The output video is available on YouTube: https://youtu.be/Mh9md_DV30o

Pipeline

The pipeline consists of 7 steps:

  • Conversion to grayscsale
  • Gaussian blur
  • Canny edge detection
  • Selection of region of interest
  • Hough transformation
  • Extrapolation of the Hough lines
  • Adding the lane lines to the original image

The functions are implemented using the OpenCV, NumPy and matplotlib libraries. The pipeline is demonstrated below with the outputs of each step:

Original image:

alt text

After grayscale conversion:

alt text

Gaussian blur applied:

alt text

Image after Canny edge detection:

alt text

Cropped according to "region of interest" mask:

alt text

Hough transformation (pixels -> lines):

alt text

Extrapolating the lines:

alt text

Final result:

alt text