Giter Site home page Giter Site logo

wolfgang-stefani / advanced_lanelines_detection Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 204.23 MB

In this project, a software pipeline was written to identify the lane boundaries in a video from a front-facing camera on a car using computer vision techniques with openCV.

License: MIT License

Jupyter Notebook 100.00%
lane-boundaries distortion-correction lane-lines-detection lane-curvature sobel-filter color-thresholding gradient-thresholding polynomial-regression computer-vision opencv-python

advanced_lanelines_detection's Introduction

Advanced Lane Finding

Udacity - Self-Driving Car NanoDegree

Binder

In this project, a software pipeline was written to identify the lane boundaries in a video from a front-facing camera on a car. The full code can be found in this IPython Notebook.

Field test on german highway A99 in Munich

I wanted to know if this algorithm runs on real videos taken by myself. So, what did I do? I took my wife out on the next highway from our apartment. She had to drive the car, so I was able to adjust the camera and record a video. Then I tested the algorithm on this video. Here ist the result: IMAGE ALT TEXT HERE

Additionally, in this longer clip the radius of the curvature and the offset of the car with respect to the center are provided: IMAGE ALT TEXT HERE

The steps of this project are the following:

  • Compute the camera calibration matrix and distortion coefficients given a set of chessboard images.
  • Apply a distortion correction to raw images.
  • Use color transforms, gradients, etc., to create a thresholded binary image.
  • Apply a perspective transform to rectify binary image ("birds-eye view").
  • Detect lane pixels and fit a polynomial to find the lane boundary.
  • Determine the curvature of the lane and vehicle position with respect to center.
  • Warp the detected lane boundaries back onto the original image.
  • Output visual display of the lane boundaries and numerical estimation of lane curvature and vehicle position.

The images for camera calibration are stored in the folder called camera_cal. The images in test_images are for testing the pipeline on single frames. If you want to extract more test images from the videos, you can simply use an image writing method like cv2.imwrite(), i.e., you can read the video in frame by frame as usual, and for frames you want to save for later you can write to an image file.

Pipeline in a nutshell

(for a very detailed description including how camera calibration is implemented, see the file "writeup.pdf")

Step 1: Read in an image

Step 2: Distortion correction

Step 3: Thresholding

Various combinations of color and gradient thresholds were tested. (Note: This step is visualized with “test4.jpg” instead of “test6.jpg” as for all the other steps because here you can see the advantages of s-channel when road has bad sun/shadow conditions)

Steps in detail:

Step 4: Perspective Transform

First, identifying four source points src (pick four points in a trapezoidal shape (similar to region masking) and after four destination points dst.

Step 5: Grayscale

Step 6: Detect lane pixels (sliding windows method) and fit a polynomial to find the lane boundary

Explicit Decision which pixels are part of the lines and which belong to the left respectively to the right line.

Steps in detail:

Step 7: Drawing

This includes: a) Draw the lines on a blank (zeroed) image b) Warp this image back to original image space using inverse perspective Matrix (Minv) c) Combine the result with the original image

advanced_lanelines_detection's People

Contributors

wolfgang-stefani avatar

Watchers

 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.