| Video and Image Processing Blockset™ | ![]() |
Find Cartesian coordinates of lines described by rho and theta pairs
Transforms

The Hough Lines block inputs are the theta and rho values of lines and a reference image. The block outputs the zero-based row and column positions of the intersections between the lines and two of the reference image boundary lines. The boundary lines are the left and right vertical boundaries and the top and bottom horizontal boundaries of the reference image.
Suppose that Line1 and Line2 intersect the boundaries of the reference image as shown in the following figure.

When the reference image and the theta and rho values of these lines are passed into the Hough Lines block, it outputs the coordinates of the intersections, as shown in the following figure.

| Port | Input/Output | Supported Data Types | Complex Values Supported |
|---|---|---|---|
Theta | Vector of theta values that represent input line(s) |
| No |
Rho | Vector of rho values that represent input line(s) | 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 |
Use the Sine value computation method parameter to specify how much memory the Hough Lines block requires. If you select Trigonometric function, the block computes sine and cosine values it needs to calculate the intersections of the lines during the simulation. If you select Table lookup, the block computes and stores the trigonometric values it needs to calculate the intersections of the lines before the simulation starts. In this case, the block requires extra memory.
Note For floating-point inputs, the Sine value computation method parameter must be set to Trigonometric function. For fixed-point inputs, the parameter must be set to Table lookup. |
If, for the Sine value computation method parameter, you select Table lookup, the Theta resolution (radians) parameter appears in the dialog box. Use this parameter to specify the spacing of the theta-axis.
See Finding Lines in Images and Measuring an Angle Between Lines in the Video and Image Processing Blockset™ User's Guide.
The following diagram shows the data types used in the Hough Lines block for fixed-point signals.

You can set the sine table, product output, and accumulator output data types in the block mask as discussed in the next section.
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 it needs to calculate the intersections of the lines during the simulation. If you select Table lookup, the block computes and stores the trigonometric values it needs to calculate the intersections of the lines before the simulation starts. In this case, the block requires extra memory. For floating-point inputs, this parameter must be set to Trigonometric function. For fixed-point inputs, the parameter must be set to Table lookup.
Specify the spacing of the theta-axis. This parameter is visible if, for the Sine value computation method parameter, you choose Table lookup.
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 is always equal to 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 are always saturated and rounded to Nearest.

As depicted in the previous figure, the output of the multiplier is placed into the product output data type and scaling. Use this parameter to specify how to designate this product output word and fraction lengths:
When you select Same as first input, these characteristics match those 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. The bias of all signals in the Video and Image Processing Blockset is 0.

As depicted in the previous figure, inputs to the accumulator are cast to the accumulator data type. The output of the adder remains in the accumulator data type as each element of the input is added to it. Use this parameter to specify how to designate this accumulator word and fraction lengths.
When you select Same as product output, these characteristics match those 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. The bias of all signals in the Video and Image Processing Blockset is 0.
Video and Image Processing Blockset | |
Video and Image Processing Blockset | |
Video and Image Processing Blockset | |
Video and Image Processing Blockset | |
Video and Image Processing Blockset | |
Video and Image Processing Blockset |
![]() | Histogram Equalization | Hough Transform | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |