Lane Detection

OpenCV pipeline

I recently became interested in working with computer vision. The idea of being able to make a machine 'see' has been around for a long time now, but it still fascinates me nonetheless. So, I took the initiative and set out to become more familiar with it. Along the way of doing so, I came across a python library called "OpenCV"

One of the most practical applications of OpenCV I saw, was using it for the purposes of robotics and autonomous cars. Thus, my first attempt at using OpenCV was to detect lane lines on a road.

This first attempt of mine is shown below. Essentially, for every frame in a video, I:

  • first make the image grayscale
  • perform a Canny Edge Detection algorithim
  • crop image to reigon of intrest
  • perform Hough Line Transforms to determine locations of lane lines

This method was very rough, but gave a good idea of the task at hand.

After joining WATonomous, a student design team aiming to make a Level 4 self-driving car, I became even more interested in computer vision and set out to learn different methods of performing computer vision tasks.

The pipeline for the new method is as follows:

  • perform a perspective transform to gain a bird's eye view
  • use a Sobel Filter to get reigons of interest
  • crop image to nearby lanes
  • create a histogram out of the image, for determing general location of lane
  • use a sliding window algorithm and fit a polynomial curve onto each lane line
  • perform an inverse perspective transform
Each step of this pipeline is shown in the carousel at the top of this page

Below is a demo of the final result of this new lane detection pipeline

The next steps for this would be to possibly train a segnet, or some other kind of neural net to perform the lane detection.

  • Github Repo
  • Timeframe: 2A
  • Relevant Technologies: Python, OpenCV