Giter Club home page Giter Club logo

carnd-lanelines-p1's Introduction

Finding Lane Lines on the Road


The goals / steps of this project are the following:

  • Make a pipeline that finds lane lines on the road
  • Reflect on your work in a written report

Test videos:

Reflection

My pipeline followed a fairly common pre-processing flow used in computer vision. The main steps consisted of the following:

  • Grayscale - Create a single channel image
  • Gaussian Blur - Remove noise
  • Canny edge detection - w/auto-threshold. Bring out edge pixels along high contrast boundaries
  • Region of Interest - Apply an image mask to exclude properties outside a defined region
  • Hough Lines - Detect lines in hough space
  • Annotate Image - Average, extrapolate, and draw a single line for both right and left lane lines

In order to draw a single line on the left and right, I modified the draw_lines() function by first separating the lines by slope by applying an index mask (a.k.a. "Fancy Indexing"). Each group of lines is then sent through a linear regression to identify individual line slopes and axis intercepts. These were then mean averaged to a single line segment and extending from the bottom border to reasonable vantage point.

First, I simplify the pallette by working with a single color channel. Grayscale

Applied Gaussian Blur. This is in addition to the noise smoothing applied by the Canny algorithm. Blurred

Edges detected! Canny

Focus attention to consider only a specific region by applying a mask. Region of Interest

Hough space magic made visible by drawing detected lines to a separate layer. Hough Lines

Alpha blend the original image with the hough lines image Alpha Blended

Now, turn the detected hough lines into a single averaged line for the left and overlay with the original image. Lane Lines

2. Potential shortcomings with the current pipeline

The current pipeline relies on static parameters tested against a small sample of images. I can foresee several potential shortcomings with this sort of manually configured approach and small sample size. For instance, this pipeline does not account for various real-world situations such as obstruction of the camera or of the lane line, optical illusions, glare, reworked roads with extra markings or no markings, snowfall just to name a few. It also relies on a single vantage point, resulting in a likely single point of failure.

3. Possible improvements to the pipeline

The "challenge" video illustrates the need for additional pre-processing. The first improvement would be to process the lane color based on hue/value/saturation to account for changes in lighting and road materials such as the bridge and shadows.

Another possible improvement would be to replace the arrays with a lightweight queue to handle steady streams of images while keeping processing and memory usage to a minimum.

I'm also curious to try different methods of sampling the image by factoring distant or long-range scene separately from the proximal or near-range scene.

Reference material

Linear Regressions

Auto-Canny thresholds - https://stackoverflow.com/questions/4292249/automatic-calculation-of-low-and-high-thresholds-for-the-canny-operation-in-open

"Fancy Indexing" - https://docs.scipy.org/doc/numpy/user/basics.indexing.html#other-indexing-options

Apply function to multiple columns - https://stackoverflow.com/questions/16353729/pandas-how-to-use-apply-function-to-multiple-columns

Numpy apply along axis - https://docs.scipy.org/doc/numpy/reference/generated/numpy.apply_along_axis.html

BRG - RGB color convert code - http://www.bogotobogo.com/python/OpenCV_Python/python_opencv3_matplotlib_rgb_brg_image_load_display_save.php

carnd-lanelines-p1's People

Contributors

ryan-keenan avatar uplink2501 avatar brok-bucholtz avatar andrewpaster avatar dmlicht avatar moe-elsadig avatar mikaelcarpenter avatar bayne avatar quadhd avatar domluna avatar jeremy-shannon avatar norman-thomas avatar rasphilco 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.