Hough Lines

Find Cartesian coordinates of lines described by rho and theta pairs

Library

Transforms

Description

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.

PortInput/OutputSupported Data TypesComplex Values Supported

Theta

Vector of theta values that represent input line(s)

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed, word length less than or equal to 32)

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

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

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Custom data types

  • Boolean

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

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

No

Pts

4-by-N matrix of intersection values, where N is the number of input lines

  • 32-bit signed integer

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.

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.

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 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.

Dialog Box

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

Sine value computation method

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.

Theta resolution (radians)

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.

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 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.

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:

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.

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.

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 Transform

Video and Image Processing Blockset

  


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