<< Chapter < Page | Chapter >> Page > |
In this section, you will use the Hough Transform, Find Local Maxima, and Hough Lines blocks to find the longest line in an image. In the second step, the algorithm used for line detection will be the basis of a lane detection procedure.
This laboratory was originally developed using the following hardware and software:
In this session we will show how to create the line detection model , and how it can be integrated in Simulation and Real-Time Implementations.
Open the “ stills_R_W.mdl ” Simulink model (generated in the " A Framework for Image Processing with the DSK6416 " module).
Add to it the blocks shown in the following table:
Block | Library | Quantity |
Edge Detection | Video and Image Processing Blockset / Analysis&Enhancement | 1 |
Hough Transform | Video and Image Processing Blockset / Transforms | 1 |
Find Local Maxima | Video and Image Processing Blockset / Statistics | 1 |
Selector | Simulink®/ Signal Routing | 2 |
Variable Selector | Signal Processing Blockset / Signal Management / Indexing | 2 |
Terminator | Simulink / Sinks | 1 |
Hough Lines | Video and Image Processing Blockset / Transforms | 1 |
Draw Shapes | Video and Image Processing Blockset / Text&Graphics | 1 |
You are now ready to set your block parameters.
Use the Image From Workspace block to import your image from the MATLAB workspace.
Set the block parameters as follows:
Use the Edge Detection block to find the edges in the intensity image. This process improves the efficiency of the Hough Lines block as it reduces the image area over which the block searches for lines. The block also converts the image to a binary image, which is the required input for the Hough Transform block. Use the default parameters.
Use the Video Viewer block to display the edges found by the Edge Detection block. Set the Input image type parameter to Intensity.
Use the Hough Transform block to compute the Hough matrix by transforming the input image into the rho-theta parameter space. The block also outputs the rho and theta values associated with the Hough matrix. Set the block parameters as follows:
Notification Switch
Would you like to follow the 'From matlab and simulink to real-time with ti dsp's' conversation and receive update notifications?