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.
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
- Clone this repository
- 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
pip install opencv-python numpy
bash python solution.py Press q to quit the video window.
Library Purpose opencv-python Image processing and video I/O numpy Array operations and math
bash pip install opencv-python numpy
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
