| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Video and Image Processing Blockset |
| Contents | Index |
| Learn more about Video and Image Processing Blockset |
Transforms

The Hough Lines block finds the points of intersection between the reference image boundary lines and the line specified by a (rho, theta) pair. The block outputs the zero-based row and column positions of the intersections. The boundary lines indicate the left and right vertical boundaries and the top and bottom horizontal boundaries of the reference image.
If the line specified by the (rho, theta) pair does not intersect two border lines in the reference image, the block outputs the values, [(-1,-1), (-1, -1)]. This output intersection value allows the next block in your model to ignore the points. Generally, the Hough Lines block precedes a block that draws a point or shape at the intersection.
The following figure shows the input and output coordinates for the Hough Lines block.

| Port | Input/Output | Supported Data Types | Complex Values Supported |
|---|---|---|---|
Theta | Vector of theta values that represent input lines |
| No |
Rho | Vector of rho values that represent input lines | Same as Theta port | No |
Ref I | Matrix that represents a binary or intensity image or matrix that represents one plane of an RGB image |
| No |
Pts | 4-by-N matrix of intersection values, where N is the number of input lines |
| No |
The Main pane of the Hough Lines dialog box appears as shown in the following figure.

If you select Trigonometric function, the block computes sine and cosine values to calculate the intersections of the lines during the simulation. If you select Table lookup, the block computes and stores the trigonometric values to calculate the intersections of the lines before the simulation starts. In this case, the block requires extra memory.
For floating-point inputs, set the Sine value computation method parameter to Trigonometric function. For fixed-point inputs, set the parameter to Table lookup.
Use this parameter to specify the spacing of the theta-axis. This parameter appears in the dialog box only if, for the Sine value computation method parameter, you select Table lookup. parameter appears in the dialog box.
The Fixed-point pane of the Hough Lines dialog box appears as shown in the following figure.

Select the rounding mode for fixed-point operations.
Select the overflow mode for fixed-point operations.
Choose how to specify the word length of the values of the sine table. The fraction length of the sine table values always equals the word length minus one:
When you select Specify word length, you can enter the word length of the sine table.
The sine table values do not obey the Rounding mode and Overflow mode parameters; they saturate and round to Nearest.
Use this parameter to specify how to designate this product output word and fraction lengths:
When you select Same as first input, the characteristics match the characteristics of the first input to the block.
When you select Binary point scaling, you can enter the word length and the fraction length of the product output, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the product output. All signals in the Video and Image Processing Blockset blocks have a bias of 0.
See Multiplication Data Types for illustrations depicting the use of the product output.
Use this parameter to specify how you would like to designate the accumulator word and fraction lengths.
When you select Same as product output the characteristics match the characteristics of the product output.
When you select Binary point scaling, you can enter the Word length and the Fraction length of the accumulator, in bits.
When you select Slope and bias scaling, you can enter the Word length, in bits, and the Slope of the Accumulator. All signals in the Video and Image Processing Blockset software have a bias of 0.
See Multiplication Data Types for illustrations depicting the use of the accumulator data type in this block.
The following figure shows Line 1 intersecting the boundaries of the reference image at [(r11, c11) ( r12, c12)] and Line 2 intersecting the boundaries at [(r21, c21) ( r22, c22)]

See Finding Lines in Images and Measuring an Angle Between Lines in the Video and Image Processing Blockset User Guide.
Video and Image Processing Blockset | |
Video and Image Processing Blockset |
![]() | Histogram Equalization | Hough Transform | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |