Skip to content

Sanjays2402/Road-Lane-Detection-Using-Computer-Vision

Repository files navigation

๐Ÿ›ฃ๏ธ Road Lane Detection Using Computer Vision

Python OpenCV NumPy

A computer vision pipeline for detecting lane lines on roads, built as part of the Self-Driving Car Engineer Nanodegree. Uses Canny edge detection, Hough transforms, and region-of-interest masking to identify and overlay lane markings on images and video.

โœจ Features

  • ๐Ÿ” Grayscale conversion and Gaussian blur for noise reduction
  • ๐Ÿ“ Canny edge detection for identifying lane boundaries
  • ๐ŸŽฏ Region-of-interest masking โ€” dynamic triangular ROI based on image dimensions
  • ๐Ÿ“ Hough line transform for detecting line segments
  • ๐Ÿงฎ Slope-based lane separation โ€” distinguishes left vs. right lane markings
  • ๐Ÿ“ˆ Line averaging & extrapolation โ€” smooth, full-length lane overlay
  • ๐ŸŽฌ Video processing โ€” frame-by-frame lane detection on MP4 files using MoviePy
  • ๐ŸŽจ Color-based lane detection โ€” HLS color space for yellow and white lane identification

๐Ÿ”„ Pipeline Overview

Input Image/Frame
  โ†’ Grayscale conversion
  โ†’ Gaussian blur (kernel=11)
  โ†’ Canny edge detection (50/150 thresholds)
  โ†’ Region-of-interest masking
  โ†’ Hough line transform
  โ†’ Slope filtering & lane averaging
  โ†’ Weighted overlay on original image

๐Ÿ› ๏ธ Tech Stack

  • Python 3 โ€” core language
  • OpenCV โ€” image processing and computer vision
  • NumPy โ€” numerical operations
  • Matplotlib โ€” visualization
  • MoviePy โ€” video processing

๐Ÿš€ Getting Started

Prerequisites

pip install opencv-python numpy matplotlib moviepy

Run the Notebook

jupyter notebook "Finding Lane Lines- CARND-Term-1- Submission.ipynb"

The notebook walks through the full pipeline with test images and video processing.

๐Ÿ“ Project Structure

Road-Lane-Detection-Using-Computer-Vision/
โ”œโ”€โ”€ Finding Lane Lines- CARND-Term-1- Submission.ipynb   # Main notebook
โ”œโ”€โ”€ output_4_1.png                                        # Sample output
โ”œโ”€โ”€ output_29_*.png                                       # Test image results
โ””โ”€โ”€ README.md

๐Ÿ“ธ Sample Results

The pipeline processes multiple test images (solid white, solid yellow, curves) and three video clips (white right, yellow left, challenge) with lane overlay rendering.

๐Ÿ‘ค Author

Sanjay Santhanam

About

๐Ÿ›ฃ๏ธ Real-time road lane detection using computer vision and OpenCV

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors