Skip to content

A python software to detection lane lines on the road. Built for self-driving cars.

Notifications You must be signed in to change notification settings

AdityaPrakash-26/Lane-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lane-Detection

This is a Python command line project made with Python, OpenCV, and Numpy.

Getting started

  1. Install python 3
  2. Clone the repo
  3. Install dependencies
  • pip3 install -r requirements.txt
  1. Run project
  • python3 main.py

How to use

  1. The program will automatically detect all lanes/edges in the lower half of the video.
  2. Either use a camera, or a recorded video with filename input.mp4
  3. Press q to exit the program.

How it works?

First, a frame is captured from the MP4 video. Then we define a region_of_interest with vertices as (100, height), (width/2, height/2), (width, height), which is essentially a triangle starting at the bottom corners, and peaking at the mid point of the image. All further calculations happen in this region.

Next, we plan to use the Canny Algorithm to detect the edges in the frame, but we first convert the image to grayscale for best results. After this, we crop the image to remove everything but our region of interest triangle, and call the OpenCV's in-built HoughLinesP function on it. This coupled with the draw function will create the lines(shown with green) and then superimpose them on our original frame, which is finally returned. This process is repeated for every frame in the video.

Output

lane.mp4

Resources

About

A python software to detection lane lines on the road. Built for self-driving cars.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages