Introduction (Line detectioN circle detection I irregular shape detection Exercise 3 coS(0) Given y=mx+C hence sin( 6 Sn(6) To prove sor=sin(O)y,+cos(0 ) x m= sin( 0) sIr (0,y") Perpendicular (O, c)4/Line of Write the proof below the test line 文☆= Edge point ☆ ☆ Test line 0 ,0) Hough transform vo.b 16
Introduction | Line detection | circle detection | irregular shape detection Exercise 3 • Write the proof below. , sin( ) , sin( ) cos( ) To prove Given , = = − = + r m c y mx c Hough transform v0.b 16 Test line Perpendicular Line of the test line =Edge point y r (x”,0) x (0,y”) =(0,c) i i i i r y x r y x so sin( ) cos( ) , sin( ) sin( ) cos( ) hence = + + = −
Introduction (Line detectioN circle detection I irregular shape detection Example To find the line y=2X+10 -m=2,C=10 Assume you dont know the line formula But have three points on the line X=1,y=8 X=2,y=6 X=3,y=4 Hough transform vo.b 17
Introduction | Line detection | circle detection | irregular shape detection Example • To find the line – y=-2x+10 – m=-2, c=10 • Assume you don’t know the line formula – But have three points on the line – X=1, y=8 – X=2, y=6 – X=3,y=4 Hough transform v0.b 17
Introduction (Line detectioN circle detection I irregular shape detection Hough line detection y=mx+c cos(8) (eg a 3 edge point example) sin(0)F* sin(e orl r=sin( O)y,+ cos(O)x We have 3 points (,y) est lines for(1 busing y t Differentθ(0°,30,60 (18),(2,6),(3,4) r=sin()*y+cos()米 (1,8 concentrate on the first ●(26) point Xi yi=(1, 8) r=4.87 (3,4) Create a test line table(0=0 0=30 30, 60,)of lines that pass thru(X,y)=(1,8) Fixed x=1,y=8, find r of Plot e vs r different e Repeat above steps for the points(26),(34) Theta(e) 60 743 90 120 643 Hough transform vo.b 150313 18
Introduction | Line detection | circle detection | irregular shape detection Hough line detection (e.g a 3 edge point example) • We have 3 points (x,y)= (1,8), (2,6), (3,4). • r=sin()*yi+cos()*xi • concentrate on the first point (xi ,yi )=(1,8). – Create a test line table (=0, 30, 60 ,..) of lines that pass thru. (xi ,yi )=(1,8) – Plot vs r • Repeat above steps for the points (2,6), (3,4). x 1 y 8 Theta () r 0 1 30 4.87 60 7.43 90 8.00 120 6.43 150 3.13 i i i i r y x or r y x y mx c sin( ) cos( ) , sin( ) sin( ) cos( ) = + + = − = + Hough transform v0.b 18 Test lines for (1,8) using Different (0o, 30o, 60o…) x y (1,8) (2,6) (3,4) =30 r=4.87 Fixed x=1,y=8, find r of different
Introduction (Line detectioN circle detection I irregular shape detection Exercise 4: y=mx+c s(6) Hough line detection y x.+ sin(8) sn(6) (eg a 3 edge point example)r=sin( e)y, cos(e)x, Test lines for(2, 6) We have 3 points (1, 8),(2, 6) (34) (1,8 concentrate on point(2, 6) Create a test line table(0=0, 30 R=4.87 60,of lines that pass (2, 6) (3,4) 0=30 Plot e vs Formula Answer S|N(SA4*P(/180 fill in the *BS2+COS(SA4*P()/180)*BS1 r column Theta Repeat above steps for the 6o points (3,4) 9o 1之 15O Hough transform vo.b 19
Introduction | Line detection | circle detection | irregular shape detection Exercise 4: Hough line detection (e.g a 3 edge point example) • We have 3 points (1,8), (2,6), (3,4). • concentrate on point (2,6). – Create a test line table (=0, 30, 60 ,..) of lines that pass (2,6) – Plot vs r • Formula • =SIN($A4*PI()/180) *B$2+COS($A4*PI()/180)*B$1 • Repeat above steps for the points (3,4). x 2 y 6 Theta () r 0 30 60 90 120 150 i i i i r y x or r y x y mx c sin( ) cos( ) , sin( ) sin( ) cos( ) = + + = − = + Hough transform v0.b 19 Test lines for (2,6) x y (1,8) (2,6) (3,4) =30 R=4.87 Answer: fill in the r column:
Introduction (Line detectioN circle detection I irregular shape detection mmx+c 3 points>3 curves p(seo). O Sn(6) sin( 0)y+cos(O)x 2 y 1818303 Hough transform 0 00090 4 7.4 620 86 1503.13 641 9876543210 Series3 series1 series2 series3 50fttftpu tf t5y200 8 2 Theta=0 Formula"=SIN(SA4*P10/180)*BS2+COS(SA4*PI(/180 *BS1 4.73 60620 Solution: the intersecting point=(r,e)=(4.5, 27 643 6〔 00 To verify: m=-cos(0)/sin(0)=-1.96, C=r/sin (0)=9.9 150313 150127 Done, real answer is y=-2X+10, m=-2, c=10( Hough method produces a solution close enough to the real answer) Hough transform vo. b
Introduction | Line detection | circle detection | irregular shape detection 3 points → 3 curves • Formula “=SIN($A4*PI()/180) *B$2+COS($A4*PI()/180)*B$1” • Solution: the intersecting point= (r,)=(4.5,27o ) • To verify: m=-cos()/sin()=-1.96, C=r/sin()=9.9 • Done, real answer is y=-2x+10, m=-2, c=10 (Hough method produces a solution close enough to the real answer) x 1 2 3 y 8 6 4 r 0 1 2 3 30 4.87 4.73 4.60 60 7.43 6.20 4.96 90 8.00 6.00 4.00 120 6.43 4.20 1.96 150 3.13 1.27 -0.60 series1 series2 series3 - 2 - 1 0 1 2 3 4 5 6 7 8 9 0 50 100 150 200 r(dist) Theta Hough transform Series1 Series2 Series3 Hough transform v0.b 20 i i i i r y x or r y x y mx c sin( ) cos( ) , sin( ) sin( ) cos( ) = + + = − = + Theta= x 2 y 6 Theta () r 0 2 30 4.73 60 6.20 90 6.00 120 4.20 150 1.27 x 1 y 8 Theta () r 0 1 30 4.87 60 7.43 90 8.00 120 6.43 150 3.13