Hough Transform: COMP 4900D Winter 2006
Hough Transform: COMP 4900D Winter 2006
Lines
Lines
Line Detection
y = ax + b
What happens when the line is vertical? The slope a goes to infinity. A better representation the polar representation
= x cos + y sin
(,)
All lines passing through a point map to a sinusoidal curve in the - (parameter) space.
= x cos + y sin
Points on the same line define curves in the parameter space that pass through a single point. Main idea: transform edge points in x-y plane to curves in the parameter space. Then find the points in the parameter space that has many curves passing through.
m
Detecting Lines by finding maxima / clustering in parameter space.
A Voting Scheme
Examples
Image
Edge detection
Hough Transform
Examples
input image Hough space lines detected
Examples
input image Hough space lines detected
Algorithm
1. Quantize the parameter space int P[0, max][0, max]; // accumulators 2. For each edge point (x, y) { For ( = 0; <= max; = +) { = x cos + y sin // round off to integer (P[][])++; } } 3. Find the peaks in P[][].
Cell Size
Choose the parameter cell size such that the algorithm is robust to noise.