This project aims to detect lane lines in images or videos using computer vision techniques. The lane detection pipeline involves several steps, including image preprocessing, edge detection, Hough line detection, and lane line averaging. This README provides an overview of the process and includes visualizations of the intermediate results.
The process begins with the original image captured by a camera mounted on a vehicle.
The original image is converted to grayscale to simplify subsequent processing steps.
A Gaussian blur is applied to the grayscale image to reduce noise and smooth out details.
The Canny edge detection algorithm is used to identify edges in the blurred image.
A region of interest (ROI) mask is applied to focus on the area where lane lines are expected.
The Hough transform is applied to detect lines in the masked image.
Detected lines are averaged and extrapolated to generate stable lane lines.
The averaged lane lines are overlaid onto the original image to visualize the detected lanes.
To process a video for lane detection, follow these steps:
- Capture frames from the video using OpenCV.
- Apply the lane detection pipeline to each frame individually.
- Combine the processed frames into a new video using OpenCV.
- Adjust parameters and settings as needed for optimal lane detection results.
To use the lane detection pipeline on your own images or videos, follow these steps:
- Clone the repository to your local machine.
- Install the required dependencies (
numpy
,opencv-python
, etc.). - Run the main script (
lane_detection.py
) with your input images or videos. - Adjust parameters as needed for optimal lane detection results.