A road lane detection system that uses computer vision techniques to detect and highlight lanes on road images and videos. The project employs OpenCV for image processing, detecting lane markings, and displaying results with annotated road lanes.
- Lane Detection: Detects lanes on road images or video streams.
- Edge Detection: Utilizes edge detection algorithms (Canny) to identify lane boundaries.
- Region of Interest (ROI): Defines and focuses on the region of the road for lane detection.
- Lane Fitting: Uses Hough Transform to fit lines over detected lane edges.
- Real-time Video Processing: Processes video streams frame-by-frame to detect lanes in real-time.
- Visualization: Displays lane-detected images with highlighted lanes.
- OpenCV: For image processing and lane detection.
- Numpy: For numerical calculations and matrix operations.
- Matplotlib: For visualizing lane-detected images and results.
- Python: For overall project development and implementation.
-
Edge Detection:
The system uses the Canny edge detector to find edges in the road image. -
Region of Interest (ROI):
A polygon is drawn over the image to focus on the region of interest where lanes are expected to be. This excludes irrelevant areas from the analysis. -
Lane Detection:
Using the Hough Line Transform, the system detects straight lines in the image that represent lanes. -
Lane Fitting:
Detected lines are processed to fit lane boundaries, drawing lane markings on the image. -
Real-time Video Processing:
The system processes each frame of a video to detect lanes dynamically and displays them.
-
Clone the repository:
git clone https://github.com/tryAhmad/road-lane-detection.git
-
Install dependencies:
pip install opencv-python numpy matplotlib
-
Input Image/Video:
Place the image or video file in the working directory or specify the file path in the script. -
Lane Detection:
Run the script to process the image/video. The system will detect the lanes and display the result with visual annotations. -
Real-time Processing:
If using a video stream, the system will continuously process each frame and show the detected lanes in real-time.
- The system assumes the input images/videos are road scenes with clear lane markings.
- Adjust the parameters of the Canny edge detector and Hough Transform for optimal results based on the input data.
- For video processing, ensure the video file is compatible with OpenCV.