A real-time lane detection system developed using Python, OpenCV, and NumPy. The project detects road lane boundaries from a driving video, highlights the driving lane, estimates the vehicle's position relative to the lane centre, and provides a basic steering suggestion.
- Real-time lane detection
- Region of Interest (ROI) selection
- Gaussian Blur for noise reduction
- Canny Edge Detection
- Hough Line Transform for lane detection
- Lane fitting using linear regression
- Temporal smoothing for stable lane tracking
- Lane area visualization
- Lane centre estimation
- Vehicle centre estimation
- Vehicle offset calculation
- Steering direction suggestion
- FPS (Frames Per Second) display
- Python 3
- OpenCV
- NumPy
opencv-lane-detection/
│
├── input/
│ └── road_car_view.mp4
│
├── output/
│ ├── output.mp4
│ ├── straight_road_detection.png
│ └── curved_road_detection.png
│
├── lane_detection.py
├── requirements.txt
├── README.md
└── .gitignore
- Read video frames
- Convert frame to grayscale
- Apply Gaussian Blur
- Detect edges using Canny Edge Detection
- Apply Region of Interest (ROI)
- Detect lane segments using Hough Line Transform
- Separate left and right lane lines
- Fit lane lines using linear regression
- Apply temporal smoothing
- Draw lane boundaries and lane area
- Calculate lane centre and vehicle centre
- Estimate vehicle offset
- Display steering suggestion and FPS
[
Clone the repository:
git clone https://github.com/<devikabraj08-ai>/opencv-lane-detection.gitMove into the project directory:
cd opencv-lane-detectionInstall the required packages:
pip install -r requirements.txtRun the project:
python lane_detection.pyPress Q to exit the application center.
- Adaptive Region of Interest
- Curved lane detection using polynomial fitting
- Perspective (Bird's-Eye View) transformation
- Lane departure warning system
- Camera calibration for improved accuracy
- Deep learning-based lane detection
Devika B Raj
B.Tech in Robotics and Automation
GitHub: https://github.com/
LinkedIn: https://www.linkedin.com/in/devika-b-raj-778785329/

