This project demonstrates lane detection in a video using OpenCV and computer vision techniques.
- Clone the repository:
https://github.com/Basfore05/Simple_Lane_Detection.git
- Install OpenCV:
pip install opencv-python
- Place the video file you want to process in the same directory as the script.
- Update the
test2.mp4
filename in the script to the name of your video file. - Run the script:
python lane_detection.py
The script performs the following steps:
- Reads a video frame-by-frame.
- Applies the Canny edge detection algorithm to detect edges in the frame.
- Extracts the region of interest (ROI) from the edge-detected frame.
- Applies the Hough transform to detect lines in the ROI.
- Averages and extrapolates the detected lines to estimate the lane boundaries.
- Draws the estimated lane lines on the original frame.
- Displays the processed frame with the lane lines.
- Python 3.x
- OpenCV
- NumPy
This project is licensed under the MIT License.