S09.s1 - Material
S09.s1 - Material
⚫ Hough transform:
⚫ start with edge point(x,y)
⚫ Find (slope k, intercept d) that passes through the most
edge points
Hough Transform
⚫ Consider the point (x,y) =(1,1)
⚫ Many lines of different slope k and intercept d canpass
through (1,1)
⚫ Thus we can rewrite equation of line through (1,1) as
1 = k.1 +d (image) => d = ‐k + 1 (parameter space)
⚫ Set of all lines passing through (1,1) (left)
can be shown as line in parameter space (right)
Parameter space
Image space k
Hough Transform:Example
⚫ Suppose image has 5 points: (1,0), (1,1), (2,1), (4,1) and (3,2)
⚫ Each of these points corresponds to the following lines that
can be plotted
d Parameter
(1,0) ‐> d = ‐k space
Image space
(1,1) ‐> d = ‐k + 1
(2,1) ‐> d = ‐2k + y
1 (4,1) ‐> d = ‐4k (3,2)
Combinations
(values) k and d
+1 (3,2) ‐> d = ‐3k (1,1) (2,1) (4,1) that intersect max
number of edges
+2
k
(1,0) x
Combinations
y
(values) k and d
that intersect max (3,2)
number of edges
(1,1) (2,1) (4,1)
k
Parameter (1,0) x
space
Image space
Accumulator Array
⚫ Accumulator array: discrete representation ofparameter
space as 2D array
⚫ Given a point in image, increment all points on it’s
corresponding line (draw line) in parameterspace
⚫ A line in image will be intersection of multiple lines in
parameter space.
Hough Transform
⚫ A Problem: The form of line cannot express
vertical line (slope k =infinity)
⚫ Alternate line representation in terms ofr, ϴ:
⚫ r, perpendicular distance of line fromorigin
⚫ ϴ, angle of line’s perpendicular to x axis
⚫ If we allow negative r, then ‐90 < ϴ< 90
Hough Transform
⚫ Point (p,q) where perpendicular to line meets line
= (rcosϴ, rsinϴ)
⚫ Consider (x,y), another point on line, gradient of line is
1. Create 2-dimensional
accumulator array
2. Search accumulator
array for maximum values
Return parameters for
k strongest lines
Hough Transform:Noise
⚫ 4 lines (left) correspond to 4 darkest points (right)
(c ) Non‐maxima
suppression (image d):
⚫ Compare every cellin
Acc(r, ϴ) to its neighbors
⚫ If greater than allneighbors,
keep cell
⚫ Otherwise set cell to 0
⚫ Can also apply thresholding
afterwards
Hough Transform on Circles
Hough Transform on Circles
Improvement of Brute ForceApproach
⚫ Observation: If we know the radius, the locations of all
possible centers lie on acircle