Member-only story

Finding Lane Lines on the Road

Naoki
6 min readFeb 4, 2017

--

In this project, I used Python and OpenCV to find lane lines in the road images.

The following techniques are used:

  • Color Selection
  • Canny Edge Detection
  • Region of Interest Selection
  • Hough Transform Line Detection

Finally, I applied all the techniques to process video clips to find lane lines in them.

Test Images

The test images are shown below.

I use these images to test my pipeline (a series of image processing) to find lane lines on the road.

Lines are in white or yellow. A white lane is a series of alternating dots and short lines, which we need to detect as one line.

Color Selection

RGB Color Space

The images are loaded in RGB color space. Let’s try selecting only yellow and white colors in the images using the RGB channels (ref: RGB Color Code Chart).

It looks pretty good except the two in which the yellow lines are not clear due to the dark shade from the tree on the left.

HSL and HSV Color Space

Using cv2.cvtColor, we can convert RGB image into different color space. For example, HSL and HSV color space.

Image Source: https://commons.wikimedia.org/wiki/File:Hsl-hsv_models.svg

HSV Color Space

How does it look when RGB images are converted into HSV color space?

--

--

Responses (2)

Write a response