Coder Social home page Coder Social logo

udacity-cnd-p1's Introduction

#Finding Lane Lines on the Road

Combined Image

Overview

The goal of this project is to create a pipeline that finds lane lines on the road for self-driving cars. It uses Python 3.5 and Opencv for building the pipeline.

Packages

Following python packages are used:

  • OpenCV
  • Matplotlib
  • Numpy
  • Math
  • Imageio
  • Moviepy

Setup

  1. Install CarND Term1 Starter Kit Docker container
  2. Launch the Docker container docker run -it -p 8888:8888 -v {$pwd}:/notebooks udacity/carnd-term1-starter-kit
  3. Open jupyter notebook from the url provided on the console

Reflection

The pipeline consists of seven steps.

First, I applied a color filter to only select the white and yellow pixels from the images (corresponding to the colors for the lane lines). This helped in removing spurious lines from the image and simplified the processing downstream.

Next, I converted the image to grayscale. Then smoothed using Gaussian blur with a kernel of size 7 and sigma of 2. Canny edge detection was applied to the smoothed image resulting in removing most of the noise from the image as seen below:

Color Filtered, Smoothed Canny Image

Next, region of interest was selected to only process subset of the image corresponding to road ahead. Hough transformation was used for line detection on the selected subset, with a threshold of 50 and max_line_gap of 100 to connect smaller spread out dashed line segments. Further, the lines were drawn by extrapolating the points across multiple frames in the video stream. Lines with slope outside threshold were discarded. The detected lines were divided into left and right buckets and then a average slope and intercept was computed across 5 video frames for drawing actual lines.

Image with Lane lines

The pipeline was tested with the white and yellow lines and the challenge video. (See outputs in test_videos_output folder)

Shortcomings

This pipeline works for simple lane detection for lanes that are straight, or have slight curves, and generally well marked highway roads . It also expects the recording camera to be placed in center of the car dashboard.

Following shortcomings exist and can be explored in a future project:

  • Works for lane that have both left and right lane lines
  • Highway entry / exits with lane merging and city roads are not handled
  • Lanes with large gaps in line or poor line markings are not detected
  • Sensitive to camera install position on the car, the region of interest is fixed and not calculated dynamically

Possible Improvements

The pipeline can be made more robust by extending for:

  • Dynamic selection of the region of interest for the road selection. A window search algorithm can be used for proper identification and location of the road and elminate false positives
  • Perform perspective transformation of the image for better lane detection and eliminate extra lanes detected in case of lane merging or other markings drawn on the road

udacity-cnd-p1's People

Contributors

chauhang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.