yang1fan2 / CarND-LaneLines-P1

Lane Finding Project for Self-Driving Car ND

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Finding Lane Lines on the Road


Files

  • P1.ipynb: the code for finding lanes.
  • test_videos_output: generated videos with annotated lanes.

The pipeline

There are 6 steps.

  • Convert the images to grayscale and apply Gaussian Blur with kerner size 5. alt text
  • Detect edges via Canny with low threshold 40 and high threshold 150. alt text
  • Only keep edges within the region of interest. alt text
  • Find lines using Hough transform from canny edges.
  • Remove invalid lines using slope (More details explained below).
  • Average the position of each of the lines and extrapolate to the top and bottom of the lane.

In order to draw a single line on the left and right lanes, I modified the draw_lines() function by adding the following stuff

  • Only keep lines whose absolute slopes are bigger than 0.3 and lower then 0.3
  • If the line is left lane and its slope is positive, remove this line.
  • If the line is right lane and its slope is negative, remote this line.
  • For all valid lines, calcuate the averaged slope and y intercept.
  • Calculate the bottom and top points giving averaged slope and y intercept.

About

Lane Finding Project for Self-Driving Car ND

License:MIT License


Languages

Language:Jupyter Notebook 99.8%Language:Shell 0.2%