Skip to content

A lane detection pipeline built using python and OpenCV

License

Notifications You must be signed in to change notification settings

Vamshi2198/Finding-Lane-Lines

Repository files navigation

Finding-Lane-Lines

This project is a part of Self-Driving Car Engineer Nanodegree Program from Udacity.

Objective:

The goal of the project is to build a pipeline to find lane lines on the road using python and OpenCV.

Instructions:

To get started, you need to have some packages. click here to setup all the requirements. Before creating the environment, change the text in the environment.yml file as provided in the repository.

After activating the environment, type jupyter notebook. copy the link and paste it in browser to work on jupyter notebook. Additionally, I have also provided python file just in case.

Pipeline:

Step 1 : Read the image.

Image

Step 2 : Convert the image to a gray scale.

gray

Step 3 : Apply Gaussian smoothing to reduce the noise in the picture.

blur

Step 4 : Apply Canny Edge Detection to extract edges.

edges

Step 5 : Apply region of interest to identify only the lanes on road.

Region

Step 6 : Apply Hough Transform to get the lines from the image

Hough

Step 7 : Apply weighted sum of input image and the image obtained after Hough Tranform to get the lanes on the road.

lane_lines

In order to draw a single line on the left and right lanes, I modified the draw_lines() function by calculating the slope, and depending on the sign of the slope (positive or negative), separated left and right lane line. Then, I took the average of the position of each of the lines and extrapolate to the top and bottom of the lane.

extrapolated

Potential Shortcomings:

  1. As the region of interest is confined, The code does not give a good output when turning.
  2. The camera is assumed to be placed at the center. so, it gives a bad output on the curves.
  3. The code does not work if there is any change in the color observed by the camera.

Possible improvements:

  1. Parameter tuning. You can check this tool to change your parameters.
  2. working on a function to account for the curved paths.

About

A lane detection pipeline built using python and OpenCV

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published