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
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:
After grayscale conversion:
Gaussian blur applied:
Image after Canny edge detection:
Cropped according to "region of interest" mask:
Hough transformation (pixels -> lines):
Extrapolating the lines:
Final result: