Skip to content

This project showcases a real-time lane detection system built with Python and OpenCV. It processes video frames to identify and visualize lane boundaries using edge detection, region masking, and line fitting techniques.

Notifications You must be signed in to change notification settings

amish5ingh/Road-Lane-Detection-Using-Python-and-OpenCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›£οΈ Road Lane Detection Using Python and OpenCV

This project implements a real-time lane detection system using Python, OpenCV, and NumPy. It processes video frames to detect road lanes using edge detection, region masking, and Hough line transformation. Ideal for self-driving car simulations, computer vision practice, or academic projects.


πŸ“ Project Structure

Road-Lane-Detection/

β”œβ”€β”€ input.mp4 # Sample road video for lane detection 
β”œβ”€β”€ RoadLaneDetectionUsingPythonAndOpenCV.py # Main Python script for lane detection
β”œβ”€β”€ venv/ # Virtual environment folder
└── README.md # Project overview and instructions

πŸš€ How to Run

πŸ”§ Step-by-Step Setup

  1. Clone this repository
  2. Create a virtual environment:

bash python -m venv venv

Activate the virtual environment:

On Windows: .\venv\Scripts\activate

On Mac/Linux: source venv/bin/activate

Install required libraries:

pip install opencv-python numpy

Run the script:

bash python solution.py Press q to quit the video window.

πŸ“¦ Required Libraries

Library Purpose opencv-python Image processing and video I/O numpy Array operations and math

Install all with:

bash pip install opencv-python numpy

πŸ“Ή What It Does

Converts each video frame to grayscale

Applies Gaussian blur and Canny edge detection

Masks the region of interest (road area)

Detects lane lines using Hough Transform

Averages and visualizes left/right lane boundaries

Overlays detected lanes on the original video

Output ====>

Road Lane Detection Output

πŸ› οΈ Technologies Used

Python

OpenCV

NumPy

VS Code (for development)

About

This project showcases a real-time lane detection system built with Python and OpenCV. It processes video frames to identify and visualize lane boundaries using edge detection, region masking, and line fitting techniques.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages