OpenCV for Lane Detection — CarND

Satyasheel
3 min readFeb 6, 2017

Can’t you please put your lane detection mode on!

This was the first project I completed for my Udacity Self-Driving Engineer Nanodegree program.

In any of the self-driving car system “Lane Detection” is one of the basic requirement to implement. This whole post is about step by step implementation for lane detection and this is implemented in python using OpenCV library. My initial assumption reader here is that you know a little bit about line equation and basics of computer vision.

Finding Lane Lines on the Road

Let's take an example image and try to build a pipeline for identifying lane lines on the road.

Sample Image for lane detection

So, where to start?

First need to identify the lanes in white colour. To do this let’s first try identify all the edges in the image based. For this we will use “Canny Edge Algorithm” (In simple terms it tries to find where is the maximum gradient change in image or at which point there is a sudden change in pixel value).

--

--