Presentation is loading. Please wait.

Presentation is loading. Please wait.

0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Detecting.

Similar presentations


Presentation on theme: "0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Detecting."— Presentation transcript:

1 0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Detecting Shapes in Images using the Hough Transform

2 Slide 2 © 2007 Texas Instruments Inc, Outline Detecting Straight Lines Detecting Straight Lanes

3 Slide 3 © 2007 Texas Instruments Inc, The Straight Line For each point ( x,y ) in the line the following equation applies: Therefore: (x 1,y 1 ) (x 2,y 2 )

4 Slide 4 © 2007 Texas Instruments Inc, Multiple Lines over a single point Each pair (m,b) defines a distinct straight line containing the point ( x,y ) (x,y) y=m 1 x+b 1 y=m 2 x+b 2 y=m 3 x+b 3 y=m 4 x+b 4

5 Slide 5 © 2007 Texas Instruments Inc, The Parameter Plane Each point in the (x,y) space(image plane) is mapped to a straight line in the (m.b) space (parameter plane). A straight line in the (x,y) space (image plane) is mapped to the intersection point of the lines corresponding to its points, in the (m.b) space (parameter plane). b =-mx 1 +y 1 b =-mx 2 +y 2 (x 1,y 1 ) (x 2,y 2 ) (x 3,y 3 ) b =-mx 3 +y 3

6 Slide 6 © 2007 Texas Instruments Inc, Dealing with digital pictures 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. The number of lines intersecting in a single point in the parameter space represents the length of the original line in the image space. N pixels M pixels N lines M lines Image Plane Parameter Plane

7 Slide 7 © 2007 Texas Instruments Inc, The Accumulator Concept The (m.b) space (parameter plane) is subdivided in cells. Each pixel (x,y) in the original image vote in the (m,b) space for each line passing through it. The votes are summed in an Accumulator b b max m b min m min m max b1b1 m1m1 N Corresponds to a straight line y=m 1 x+b 1 of N pixels length

8 Slide 8 © 2007 Texas Instruments Inc, Using Polar Coordinates (x 1,y 1 ) (x 2,y 2 ) r θ For each point ( x,y ) in the line the following equation applies: In particular:

9 Slide 9 © 2007 Texas Instruments Inc, The Motivation for Polar Coordinates x = r r Vertical lines cannot be mapped to the (m,b) space, since: Vertical lines can be described using polar coordinates :

10 Slide 10 © 2007 Texas Instruments Inc, Hough Transform - The ( r, θ) Space (x 1,y 1 ) (x 2,y 2 ) (x 3,y 3 ) r=x 2 cosθ+y 2 sinθ r=x 1 cosθ+y 1 sinθ r=x 3 cosθ+y 3 sinθ (x 4,y 4 ) r=x 4 cosθ+y 4 sinθ Hough Transform - Each point in the (x,y) space is mapped to a sinusoid in the ( r, θ) space. Sinusoids corresponding to collinear points in the (x,y) space intersect at a common point in the ( r, θ) space.

11 Slide 11 © 2007 Texas Instruments Inc, Accumulators in the ( r, θ) Plane θ θmax r θ min r min r max θ 1θ 1 r1r1 N Corresponds to the straight line r 1 =xcosθ 1 +xsinθ 1 of N pixels length

12 Slide 12 © 2007 Texas Instruments Inc, The Region of Interest (ROI) The ROI is the area in the original image, where lines need to be detected. The ROI for the picture above is: x max x min y max y min r max

13 Slide 13 © 2007 Texas Instruments Inc, Longest Line Detection Edge Detection Hough Transfom Draw Line Input Image Output Image Binary Image Longest Line (r m,θ m ) + Find Max. Accumulator Array Hough Algorithm The line is reconstructed using the equation: r m =xcosθ m +ysinθ m (Calculated for the values of (x,y) that “voted” for the accumulator cell (r m, θ m ).

14 Slide 14 © 2007 Texas Instruments Inc, Line Detection Model

15 Slide 15 © 2007 Texas Instruments Inc, The Hough Algorithm

16 Slide 16 © 2007 Texas Instruments Inc, Line Drawing & Image Construction

17 Slide 17 © 2007 Texas Instruments Inc, Line Detection - Hands-On Simulation Implementation using the DSK6416

18 Slide 18 © 2007 Texas Instruments Inc, Simulation Image File MATLAB ® Display Line Detection

19 Slide 19 © 2007 Texas Instruments Inc, DSK6416 Image File MATLAB Display Line Detection Script RGB to Grayscale RTDX Real Time Implementation

20 Slide 20 © 2007 Texas Instruments Inc, From Line to Lane 1.Find two longest lines in the picture 2.Draw Polygon

21 Slide 21 © 2007 Texas Instruments Inc, Lane Detection Hough Transfom Draw Lane Input Image Output Image Binary Image + Find 2 Max. Accumulator Array Hough Algorithm Enhanced Edge Detection (r,θ) Correction Determine ROI Two Longest Lines (r m,θ m ) / (r n,θ n ) Two lines are reconstructed using the equation: r m =xcosθ m +ysinθ m (Calculated for the values of (x,y) that “voted” for the two maximum values in the accumulator cell. A polygon is constructed connecting those lines

22 Slide 22 © 2007 Texas Instruments Inc, Enhanced Edge Detection An histogram-based thresholding edge detection method enables the identification of areas where pixels change from light to dark or dark to light, which might indicate lane edges. Edge Detection Histogram Based Threshold ≥ ROI Logical AND Binary Image

23 Slide 23 © 2007 Texas Instruments Inc, Edge Detection Only Edge Detection with Histogram Based Thresholding Why Enhanced Edge Detection?

24 Slide 24 © 2007 Texas Instruments Inc, No Correction (r,θ) Correction The Need for (r,θ) Correction Misdetection of the longest lines

25 Slide 25 © 2007 Texas Instruments Inc, (r,θ) Correction If the lane position given by the Hough Transform block changes abruptly with respect to its values in the previous frame, the Rho Theta Correction subsystem discards the current position and keeps the previous position. Maximum allowable variation in E and F with respect to previous values are:

26 Slide 26 © 2007 Texas Instruments Inc, Lane Detection Model

27 Slide 27 © 2007 Texas Instruments Inc, Enhanced Edge Detection

28 Slide 28 © 2007 Texas Instruments Inc, The Hough Algorithm

29 Slide 29 © 2007 Texas Instruments Inc, Lane Drawing

30 Slide 30 © 2007 Texas Instruments Inc, Lane Detection - Hands-On Simulation Implementation using the DM6437 DVDP


Download ppt "0 - 1 © 2007 Texas Instruments Inc, Content developed in partnership with Tel-Aviv University From MATLAB ® and Simulink ® to Real Time with TI DSPs Detecting."

Similar presentations


Ads by Google