Skip to content

A computer vision project using OpenCV to detect road lane lines in driving videos. It processes video frame-by-frame using edge detection, region masking, Hough transforms, and overlays lane lines to assist self-driving logic.

Notifications You must be signed in to change notification settings

RayanAIX/Road-Lane-Detection-OpenCV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🛣️ Road Lane Detection using OpenCV

This computer vision project detects road lane lines from a dashcam driving video using traditional image processing techniques in OpenCV. It simulates a basic lane-following system, which is an essential component of autonomous driving.


🎥 Input vs Output Video

🔹 Original Input Video

solidWhiteRight.mp4

🔸 Output Video with Lane Detection

lane_detected_output.mov

📹 Input Video


⚙️ How It Works

  1. Convert video frame to grayscale
  2. Apply Gaussian blur to reduce noise
  3. Use Canny edge detection
  4. Define region of interest (ROI) to mask unwanted parts
  5. Apply Hough Line Transform to detect straight lines
  6. Average and extrapolate the left/right lane lines
  7. Overlay detected lanes onto the original frame

🧠 Technologies Used

  • Python 3
  • OpenCV
  • NumPy

📦 Requirements

opencv-python
numpy

Install them using:
pip install -r requirements.txt


📁 Project Structure

File Description
lane_detection.py Main script that processes the video
solidWhiteRight.mp4 Input driving video
lane_detected_output.mp4 Output video with detected lanes
requirements.txt Python libraries used
README.md Project documentation

🚀 How to Run

pip install -r requirements.txt
python lane_detection.py

🔭 Future Enhancements

  • Support curved lanes using polynomial fitting
  • Integrate real-time webcam lane detection
  • Use color masks to detect yellow lanes better
  • Deploy in embedded systems or mobile devices

👨‍💻 Author

Muhammad Rayan Shahid
AI & ML Enthusiast | LinkedIn | GitHub


⭐ If you found this project useful, please consider starring the repository!

About

A computer vision project using OpenCV to detect road lane lines in driving videos. It processes video frame-by-frame using edge detection, region masking, Hough transforms, and overlays lane lines to assist self-driving logic.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages