0-1
Outline
(x1,y1)
(x2,y2)
y m x b
• For each point (x,y) in the line the following equation applies:
y m x b
• Therefore:
y1 m x1 b
© 2007 Texas Instruments Inc,
y 2 m x2 b
Slide 3
Multiple Lines over a single point
y=m2x+b2
y=m1x+b1
(x,y) y=m4x+b4
y=m3x+b3
b =-mx1+y1
(x1,y1)
(x2,y2)
(x3,y3)
b =-mx3+y3
b =-mx2+y2
• Each point in the (x,y) space(image plane) is mapped to a
straight line in the (m.b) space (parameter plane).
M lines
M
pi
xe
ls
• A line formed by M (N) pixels in the image space will be mapped to the
intersection point of M (N) lines in the parameters space, where each
line corresponds to a pixel in the image space.
b1 N
• The votes are summed in an
Accumulator
bmin
mmin m1
© 2007 Texas Instruments Inc,
mmax m Slide 7
Using Polar Coordinates
• For each point (x,y) in the
r x cos y sin
line the following equation
applies:
r x cos y sin
(x1,y1) • In particular:
r x1 cos y1 sin
(x2,y2)
r r x2 cos y2 sin
x r cos 0 r sin 0
xr
r=x2cosθ+y2sinθ
r=x4cosθ+y4sinθ
(x1,y1)
r=x1cosθ+y1sinθ
(x3,y3)
(x2,y2)
(x4,y4)
r=x3cosθ+y3sinθ
θ
θmax
θ1 N
θmin
rmin r1
© 2007 Texas Instruments Inc,
rmax r Slide 11
The Region of Interest (ROI)
ymax r max
ymin
xmin xmax
• The ROI is the area in the original image, where lines need to be
detected. The ROI for the picture above is:
Hough Algorithm
Input
Image
Edge
Detection
Hough
Transfom
Find
Max.
Draw Line
+ Output
Image
Binary
Image
• Simulation
MATLAB® Display
Image File
Line
Detection
MATLAB
Display
Image
Script
File
RGB
to
Grayscale
RTDX RTDX
Line
Detection
DSK6416
© 2007 Texas Instruments Inc, Slide 19
From Line to Lane
2. Draw Polygon
Binary
Image Two Longest Lines
Accumulator (rm,θm) / (rn,θn)
Array
Edge
Detection
Logical Binary
ROI
AND Image
≥
Histogram Based
Threshold
(r,θ) Correction
• Simulation