← udacity portfolio
self driving car nd · computer vision · August 2018

Lane Finding (Project 1)

The first SDC nanodegree project — Hough-transform lane detection on highway video with classical OpenCV. Gateway drug to computer vision.

What it did

Project 1 of the Udacity SDC nanodegree. Detect highway lane markings from dashcam video — six lines of OpenCV per frame, then average across time to draw two clean lane edges on top of the source footage.

The pipeline

  1. RGB → grayscale.
  2. Gaussian blur (kernel size 5).
  3. Canny edge detection (low/high thresholds tuned by eye).
  4. Region-of-interest mask — trapezoid centered on the ego lane.
  5. Probabilistic Hough transform → line segments.
  6. Linear-fit each side (left + right) → two extrapolated lane lines.
  7. Overlay on the source frame.

What was actually tricky

The Hough threshold + ROI mask are a pair you tune together. Loose Hough + tight ROI works on the easy clip; tight Hough + loose ROI works on the curvy clip; neither setting works on both. The lesson: hand-tuned pipelines win the easy demo and lose the second-easiest one.

What I’d do differently with hindsight

What it taught me

Computer vision pipelines compound: each step has a small parameter budget, and they trade off against each other. There’s no global optimum across diverse scenes — only good enough for this footage. The discipline of accepting “good enough on the test set” before shipping is the first taste of an ML mindset, even in pre-ML code.


Source archive: Shivam-Bhardwaj/LaneFinding (archived)
Writeup last touched: 2026-05-22