Hough Transform General idea: transform from image coordinates to parameter space of feature Need parameterized model of features For each piel, determine all parameter values that might have given rise to that piel; vote At end, look for peaks in parameter space Hough Transform for Lines Generic line: = a+b Parameters: a and b 1
Hough Transform for Lines 1. Initialize table of buckets,, indeed b a and b,,tozero. For each detected edge piel (,): a. Determine all (a,b) such that = a+b b. Increment bucket (a,b) 3. Buckets with man votes indicate probable lines Hough Transform for Lines a b
Hough Transform for Lines a b Difficulties with Hough Transform for Lines Slope / intercept parameterization not ideal Non-uniform sampling of directions Can t represent vertical lines Angle / distance parameterization Line represented as (r, ) where cos + sin = r r 3
Finding Lines Using the Hough Transform i, i cos sin i i Algorithm Discretize the parameter spaces ρ and θ. Create Accumulator arra A(1..R,1..T). Set A(k,h)=0 for all k and h. For each image edge E(i,j)=1 For h=1 T ρ =i cosθd(h)+j sinθd (h) Find inde k: ρd ρ is closest to ρ Increment A(h,k) b one. Find all local maima (kp, hp) such that A (kp, hp)>τ 4
Hough Transform Results Forsth & Ponce Hough Transform Results Forsth & Ponce 5
Finding Lines Using the Hough Transform Strong local peaks correspond to lines. Finding Lines Using the Hough Transform Resolution Issues 6
Bucket Selection How to select bucket size? Bucket Selection How to select bucket size? Too small: poor performance on nois data Too large: poor accurac, long running times, possibilit of false positives Large buckets + verification and refinement Problems distinguishing nearb lines Be smarter at selecting buckets Use gradient information to select subset of buckets More sensitive to noise 7
Hough Transform: Results Image Edge detection Hough Transform Summar Hough Transform Smart counting Local evidence for global features Organized in a table Careful with parameterization! Problem: Curse of dimensionalit Works great for simple features with 3 unknowns Will fail for comple objects Problem: Not a local algorithm 8
Hough Transform What else can be detected using Hough transform? Hough Transform What else can be detected using Hough transform? Anthing, but dimensionalit is ke 9
Finding Circles b Hough Transform b0 r (i,i) Equation of Circle: a0 ( a r i 0 ) ( i b0 ) Finding Circles b Hough Transform b0 r (i,i) Equation of Circle: a0 ( a r If radius r is known: b (i,i) Accumulator arra A(a,b) i 0 ) ( i b0 ) Circles! a 10
Finding Circles b Hough Transform b0 r (i,i) a0 If r is not known Use accumulator arra A(a,b,r) For each h( (i,i)increment ta( A(a,b,r) such hthatt ( i a ) ( i b ) r Using Gradient Information Can save lot of computations! Given: location (i,i) Edge direction φi 11
Using Gradient Information Can save lot of computations! Given: location (i,i) Edge direction φi Assume r is known: (i,i) φi (a,b) a=-rcosφ b=-rsinφ Need to increment onl one point in Accumulator Arra. 1