Case Study 06

Real-World Lane Detection

Classical computer vision under adverse conditions

PythonOpenCVCanny/Hough
View on GitHub (opens in new tab)

The Problem

Classical lane-detection pipelines built on edge detection tend to work well in demo conditions and fall apart in the real world — shadows, motion blur, and harsh lighting all break fixed-threshold approaches. The goal was to deliberately stress-test a pipeline against those conditions rather than only evaluate it on clean footage.

Approach

  1. 01Built a classical computer vision pipeline using Canny edge detection and Hough transform to identify lane lines from road images.
  2. 02Deliberately stress-tested the pipeline against adverse conditions — shadows, motion blur, and bright/overexposed lighting — rather than only clean, ideal frames.
  3. 03Improved robustness with adaptive thresholding (replacing fixed thresholds), histogram equalization for lighting normalization, and slope filtering to reject spurious edge detections.

Visuals

Mountain road with detected lane lines overlaid in bright green, extending from the bottom of the frame toward the vanishing point
Final output — detected lane lines overlaid on a mountain-road test frame.
Canny edge detection map of the same road frame, showing white edge outlines of the road, lane lines, and terrain against a black background
Intermediate step — Canny edge map (thresholds 150/300) feeding the Hough line detection.

Results

Adaptive-threshold pipeline reduced false lane detections compared to the fixed-threshold baseline.

Maintained detection reliability across shadow, motion-blur, and bright-light test conditions.

Reflection

Classical CV techniques like Canny and Hough are fast and interpretable, but this project made clear how fragile fixed-threshold approaches are outside ideal lighting. Adaptive thresholding closed a lot of that gap without needing to reach for a deep-learning-based approach.