Code Monkey home page Code Monkey logo

carnd-lanelines-p1's Introduction

Finding Lane Lines on the Road

Combined Image

Overview

This repo contains the code written to complete the first project on Udacity Self-Driving Car Nanodegree Program (Term 1). This project aggregates algorithms to identify and mark lane lines on the road. The algorithms work for images and videos which are taken from a camera at the center of a vehicle.

Description

The pipeline consists of six steps:

  1. Converts the image into a gray scaled version using the cv2.cvtColor() function.
  2. Applies a Gaussian blur to the image using the cv2.GaussianBlur() function.
  3. Uses a Canny transformation to find edges on the image using the cv2.Canny() function.
  4. Applies an image mask to keep only the region of interest using the cv2.fillPoly() function as well as the cv2.bitwise_and() function.
  5. Uses a Hough transformation to find the lines on the masked image using the cv2.HoughLinesP() function. It also draws these lines onto a black image (all black) of the same size as the original image using the cv2.line() function.
  6. Merges the output of the last step with the original image to represent the found lines on it using the cv2.addWeighted() function.

In order to draw a single line on the left and right lanes, I modified the draw_lines() function (part of step 5) by adding a decision whether a line segment is part of the left lane or the right lane. The decision contains two parts. First, the slope ((y2-y1)/(x2-x1)) must be either positive or negative. Second, the positions of x1 and x2 must both be either on the left or on the right side of the image. The functions numpy.polyfit() and numpy.poly1d() are being used to average and extrapolate the line segments.

Step Output
1 alt text
2 alt text
3 alt text
4 alt text
5 alt text
6 alt text

carnd-lanelines-p1's People

Contributors

pascalirminger 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.