| Video and Image Processing Blockset™ | ![]() |
Transforms

Use the Hough Transform block to find lines in an image. The block maps points in the Cartesian image space to curves in the Hough parameter space using the following equation:
![]()
The block outputs a parameter space matrix whose rows and columns correspond to the rho and theta values, respectively. Peak values in this matrix represent potential lines in the input image. The theta values range from -pi/2 radians to pi/2 radians with a step-size determined by the Theta resolution (radians) parameter.
| Port | Input/Output | Supported Data Types | Complex Values Supported |
|---|---|---|---|
BW | Matrix that represents a binary image | Boolean | No |
Hough | Parameter space matrix |
| No |
Theta | Vector of theta values |
| No |
Rho | Vector of rho values | Same as Theta port | No |
If the output of the Hough port is floating point, the outputs of the Theta and Rho ports are the same data type.
Use the Theta resolution (radians) parameter to specify the spacing of the Hough transform bins along the theta-axis.
Use the Rho resolution parameter to specify the spacing of the Hough transform bins along the rho-axis.
If you select the Output theta and rho values check box, the Theta and Rho ports appear on the block. The block outputs vectors of theta and rho values at these ports.
Use the Output data type parameter to specify the data type of your output signal.
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 Transform block for fixed-point signals.


You can set the sine table, rho, product output, accumulator, Hough output, and Theta output data types in the block mask as discussed in the next section.
The Main pane of the Hough Transform dialog box appears as shown in the following figure.

Specify the spacing of the Hough transform bins along the theta-axis.
Specify the spacing of the Hough transform bins along the rho-axis.
If you select this check box, the Theta and Rho ports appear on the block. The block outputs vectors of theta and rho values at these ports.
Specify the data type of your output signal.
The Fixed-point pane of the Hough Transform 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:
When you select Binary point scaling, you can enter the word length of the sine table values, in bits.
When you select Slope and bias scaling, you can enter the word length of the sine table values, in bits.
The sine table values do not obey the Rounding mode and Overflow mode parameters; they are always saturated and rounded to Nearest.
Choose how to specify the word length and the fraction length of the rho values:
When you select Binary point scaling, you can enter the word length and the fraction length of the rho values, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the rho values. The bias of all signals in Video and Image Processing Blockset is 0.

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 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.
Choose how to specify the word length and fraction length of the Hough output of the block:
When you select Binary point scaling, you can enter the word length of the Hough output, in bits. The fraction length is always 0.
When you select Slope and bias scaling, you can enter the word length, in bits, of the Hough output. The slope is always 0. The bias of all signals in the Video and Image Processing Blockset is 0.
Choose how to specify the word length and fraction length of the theta output of the block:
When you select Binary point scaling, you can enter the word length and the fraction length of the theta output, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the theta output. 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 |
![]() | Hough Lines | Image Complement | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |