Professional Documents
Culture Documents
Lec 9
Lec 9
Lec 9
Instructor: S. Narasimhan
Wean 5403
T-R 3:00pm – 4:20pm
Boundary Detection:
Hough Transform
Lecture #9
Reading: Computer Vision (Ballard and Brown): Chapter 4
“Use of the Hough Transform to detect lines and curves in pictures”, Comm. ACM
15, 1, January 1972 (pgs 112-115)
Boundaries of Objects
http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/bench/html/images.html
Boundaries of Objects from Edges
Image
Edge detection
and Thresholding
Image Noisy edge image
Incomplete boundaries
Thinning
Edge Tracking Methods
• Repeat
Fitting Lines to Edges (Least Squares)
y i
i
x i
i
( x x) i
2
N N i
Problem with Parameterization
y
1
E
N
i
( xi cos y i sin ) 2
y f ( x) ax 3 bx 2 cx d
that best fits the given points ( xi , yi )
Minimize:
x
1
i
3 2 2
[ y ( axi bxi cxi d )]
N i
Using: E E E E
0 , 0 , 0 , 0
a b c d
• Cost:
– It is not feasible to check all combinations of features
by fitting a model to each possible subset
Hough Transform
y mx c y
Equation of Line: y mx c
Find: (m, c)
Consider point: ( xi , yi ) ( xi , yi )
x
Image Space
yi mxi c or c xi m yi
m
Parameter space also called Hough Space
(m, c)
c
Parameter Space
Line Detection by Hough Transform
y
Algorithm:
NOTE: m y
Large Accumulator ( xi , yi )
More memory and computations
Here 0 2
0 max
Given points ( xi , yi ) find ( , ) ?
Horizontal axis is θ,
vertical is rho.
Image votes
space
Mechanics of the Hough transform
• Difficulties • How many lines?
– how big should the cells – Count the peaks in the
be? (too big, and we Hough array
merge quite different lines; – Treat adjacent peaks as
too small, and noise
a single peak
causes lines to be missed)
• Which points belong to each
line?
– Search for points close to
the line
– Solve again for line and
iterate
Fewer votes land in a single bin when noise increases.
Adding more clutter increases number of bins with false peaks.
Real World Example
Parameter Space
Finding Circles by Hough Transform
Equation of Circle:
( xi a ) 2 ( yi b) 2 r 2
Equation of Circle:
( xi a ) 2 ( yi b) 2 r 2
Edge Location ( xi , yi )
Edge Direction i
a x r cos
b y r sin
xc xi rki cos ki
yc yi rki sin ki
Increment Accumulator: A( xc , yc ) A( xc , yc ) 1
Find Local Maxima in A( xc , yc )
Hough Transform: Comments