Features • Demo • Installation • Usage • How It Works • Contributing
A robust lane detection system that identifies and tracks road lane markings in real-time using computer vision techniques. This project processes video streams from dashcam footage and overlays detected lane boundaries, providing a visual guide for autonomous vehicle systems or driver assistance applications.
- 🎥 Real-time Processing - Processes video streams with minimal latency
- 🎯 Accurate Detection - Uses advanced edge detection and Hough transforms
- 🖼️ Region of Interest (ROI) - Focuses on relevant road areas for improved performance
- 📊 Lane Overlay - Visual representation of detected lanes on original footage
- ⚡ Efficient Algorithm - Optimized for performance on standard hardware
- 🔧 Configurable Parameters - Easy tuning for different road conditions
The system processes dashcam footage and outputs video with detected lane markings highlighted in real-time.
Input: Road view from vehicle camera (road_car_view.mp4)
Output: Processed video with lane overlay (out.gif)
- Python 3.7 or higher
- pip package manager
-
Clone the repository
git clone https://github.com/Devatva24/Lane-Detection.git cd Lane-Detection -
Install required dependencies
pip install opencv-python numpy matplotlib
python lane_detection_codespace.pyThe script will:
- Load the input video file (
road_car_view.mp4) - Process each frame to detect lane markings
- Save the output with detected lanes
You can modify parameters in the script to adjust:
- Canny edge detection thresholds
- Hough transform parameters
- Region of interest coordinates
- Line drawing style and color
The lane detection pipeline consists of several key steps:
- Convert frames to grayscale
- Apply Gaussian blur to reduce noise
- Use Canny edge detection to identify lane boundaries
- Highlight areas with significant intensity changes
- Define a polygonal mask to focus on the road area
- Filter out irrelevant portions of the image
- Apply Hough transform to detect straight lines
- Identify lane markings from detected edges
- Average and extrapolate detected line segments
- Create smooth, continuous lane boundaries
- Draw detected lanes on the original frame
- Combine with input video for final output
Lane-Detection/
├── lane_detection_codespace.py # Main detection script
├── road_car_view.mp4 # Sample input video
├── out.gif # Output demonstration
├── README.md # Project documentation
├── .gitignore # Git ignore rules
└── .gitattributes # Git attributes
- Python - Core programming language
- OpenCV - Computer vision library for image processing
- NumPy - Numerical computing for array operations
- Matplotlib - Visualization and debugging (optional)
- Curved lane detection using polynomial fitting
- Multi-lane detection support
- Night-time and adverse weather conditions
- Real-time webcam input support
- Integration with deep learning models (YOLO, U-Net)
- Lane departure warning system
- Performance optimization using GPU acceleration
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Devatva24
- GitHub: @Devatva24
- Inspired by autonomous vehicle research and ADAS systems
- Built using open-source computer vision libraries
- Special thanks to the OpenCV community
