Giter Site home page Giter Site logo

carnd-lane-lines-project-1's Introduction

Finding Lane Lines on the Road

Udacity - Self-Driving Car NanoDegree


Pipeline Process

Jupyter Notebook with Embedded Videos

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 we detect lane lines in images using Python and OpenCV.


Reflection

Lane Detection Pipeline

My lane detection pipeline consisted of 7 steps:

  1. We first run color selection on the input frame to select only the yellow and white shades of color and mask all other colors. To do this, we convert the input image to HSV (hue, saturation, value) color space. This makes it easier to select required colors using OpenCV's inRange function. Input Image Color Selection
  2. Then we transform the color selected frame to a grayscale frame, to make the edge detection step simpler
    Grayscale
  3. To normalize any noise and sharpness, we perform a Gaussian blur on the grayscale image Gaussian Blur
  4. We then run the Canny Edge Detection algorithm to detect edges in the frame Canny Edge
  5. We apply a Region of Interest mask which is a fixed polygon area to only retain the road and remove trees and fence from the frame Region of Interest Mask
  6. Using probabilistic Hough transform we find line segments in the frame. Then, using draw_lines() function we draw the lines on the frame inplace. draw_lines() takes all the lines found by the Hough transform, splits them into left/right line segments using their slope, averages multiple segments to get a single line each for left and right lane and extrapolates the line from bottom of ROI to the top. The function also performs a moving average over previously found line segments to smooth out the lane lines drawn. Hough Lines
  7. We now have a blank image with only the lane lines highlighted in red and the original input image. We superimpose the lane lines image on the original image. This is the final output. Weighted Image Overlay

Potential shortcomings with the current pipeline

This pipeline performs well on all the provided sample data. But, the current pipeline is limited to detecting only the left and right bounds of the current lane. It cannot detect the curvature for a curved road. The other shortcoming is, if the lane lines are not detected for a few frames (due to missing lane lines or traffic), the moving average might yield a wrong result.

Possible improvements to the pipeline

The pipeline can be improved to detect the curvature of the lane along with the bounds. Also, instead of using simple moving average to extrapolate missing lane lines, we could use a better regression model to identify missing data.

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.