Skip to content

sauravkdeo/CarND-LaneLines-P1

Repository files navigation

Lane Detection


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

1. Results

2. Pipeline

My pipeline consisted of 6 steps.

Step 1 : Grayscale

The RGB image is converted to grayscale image.

alt text

Step 2 :Noise Reduction

The grayscale image is processed using GaussianBlur to reduce the noise and smoothen the image.kernel size =3 was used for denoisining.

alt text

Step 3 :Edge Detection

Once the gracscale image is smoothened, Canny transform is applied on the smoothened grayscale image to detect the edges in the images.Low threshold = 50 & high threshold = 150 were used for edge detection.

alt text

Step 4 :Image Masking

We know that the the lanes will always be in the specific area of the image. Hence we used masking to keep only the lane specific area after edge detection. All other areas apart from the lane region were removed.

alt text

Step 5 : Hough Transformation

The masked image was processed and used to detect the edge coordinates in pixel.Using Hough transformation, staring and end coordinates of the all the edges were returned in the form of array.

alt text

Step 6 : Draw Lines

Once we had the set of coordinates representing the lines. The first task was to separate left lane coordinate set from right lane coordinate set. I used the slope information to separate these two, as left lane lines will have negative slope and right lane line will have positive slope. I stored the the set of left lane lines and right lane lines in two separate arrays.

For each lane lines, we calculated the weighted mean slope and intercept.

We used this information to draw the lines on the original image.

alt text

3. Identify potential shortcomings with your current pipeline

The current pipeline has several shortcoming and limitations.

  • This algorithm is hardcoded to mask certain region.If the front are not in that region, the algorithm will not work properly.
  • The algorithm will only work fine for the straight lanes.On curved paths, there is a possibility that the slopes of the left lanes and right lane lines may be same, leading to improper identification of the lane.
  • The algorithm will only work fine, when the brightness and the contrast of the image is good, as the algorithm is based on the edge detection technique.

4. Suggest possible improvements to your pipeline

  • Pre-process the image to adjust the contrast and brightness of the image to properly detect the edges.

  • Use homography to view the image from top before edge detection(canny transformation)

  • Use Image from an infrared camera

  • Adding an outlier reduction approach like RANSAC on the hough lines.

  • Using curve fitting to plot the curve instead of straight lines

Releases

No releases published

Packages

No packages published