CV Lab 17 · Module 6 — Shape & Structure

Hough Transform — Lines & Circles

Two canvases, permanently linked: whatever happens in Image Space instantly redraws Hough Space next to it. Place a point, watch its curve appear. Add two more in a row, watch the curves lock onto one glowing peak — that peak is the line.

Curves cross where votes agree Each point casts a sinusoidal curve into (θ,ρ) space. Points on the same real line all cross at one shared point — discovered purely by counting agreement, never by solving equations directly.
Raw point / edge pixel Hough-space curve Accumulator peak Detected line / circle
📷 Image Space
📊 Hough Space
Ready.
Live Explanation
Loading…

Click empty space on Image Space to drop a point. Click-drag an existing point to move it. Watch Hough Space update at 60fps as you drag.

Voting instead of solving

Why polar form (ρ,θ)

y=mx+c breaks on vertical lines. ρ=x·cosθ+y·sinθ describes every possible line with no special cases — essential for a voting scheme that can't afford exceptions.

Only hysteresis needs to be live

Blur and gradient only depend on the image, not your threshold choice — computed once. Moving Low/High only reruns the cheap flood-fill classification step, which is why the sliders here feel instant.

Resolution is a trade-off

Coarser θ/ρ steps merge nearby votes into bigger, more forgiving bins — good against noise, bad for precision. Finer steps are precise but split real votes across more bins, weakening every peak.

Predict, then verify

In Laser Target Lock, you set the θ/ρ resolution extremely fine (1° and 1px) on a genuinely noisy image, without touching Canny. What happens to the heatmap?