Hough Transform - Find lines in images

Library

Transforms

Description

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.

PortInput/OutputSupported Data TypesComplex Values Supported

BW

Matrix that represents a binary image

Boolean

No

Hough

Parameter space matrix

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (unsigned, fraction length equal to 0)

  • 8-, 16-, 32-bit unsigned integer

No

Theta

Vector of theta values

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed)

  • 8-, 16-, 32-bit signed integer

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.

Examples

See Finding Lines in Images and Measuring an Angle Between Lines in the Video and Image Processing Blockset™ User's Guide.

Fixed-Point Data Types

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.

Dialog Box

The Main pane of the Hough Transform dialog box appears as shown in the following figure.

Theta resolution (radians)

Specify the spacing of the Hough transform bins along the theta-axis.

Rho resolution

Specify the spacing of the Hough transform bins along the rho-axis.

Output theta and rho values

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.

Output data type

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.

Rounding mode

Select the rounding mode for fixed-point operations.

Overflow mode

Select the overflow mode for fixed-point operations.

Sine table

Choose how to specify the word length of the values 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.

Rho

Choose how to specify the word length and the fraction length of the rho values:

Product output

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:

Accumulator

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:

Hough output

Choose how to specify the word length and fraction length of the Hough output of the block:

Theta output

Choose how to specify the word length and fraction length of the theta output of the block:

See Also

2-D DCT

Video and Image Processing Blockset

2-D FFT

Video and Image Processing Blockset

2-D IDCT

Video and Image Processing Blockset

2-D IFFT

Video and Image Processing Blockset

Find Local Maxima

Video and Image Processing Blockset

Hough Lines

Video and Image Processing Blockset

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS