Hough Transform
Find lines in images
Libraries:
Computer Vision Toolbox /
Transforms
Description
Use the Hough Transform block to find straight lines in an image. The block outputs the Hough space matrix and, optionally, the rho-axis and theta-axis vectors. Peak values in the matrix represent potential straight lines in the input image. You can use the output of the Hough Transform block to find straight lines in the image by using the Hough Lines block. Alternatively, you can use a custom algorithm to identify potential straight lines by locating peaks in the Hough space matrix.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Algorithms
The Hough Transform block implements the Standard Hough Transform (SHT). The SHT uses the parametric representation of a line:
The block uses the upper-left corner pixel of the image as the origin, assigning it the xy-value of (0, 0).
The rho value indicates the perpendicular distance from the origin to the Hough line.
The theta value indicates the angle of inclination of the normal line from the x-axis. The range of theta is , with a step-size determined by the Theta resolution (radians) parameter. The SHT measures the angle of the line clockwise, with respect to the positive x-axis.
The Hough Transform block creates an accumulator matrix. The
(rho, theta) pair represent the location of a cell in the accumulator
matrix. Every valid (logical true
) pixel of the input binary image
represented by (row, col) produces a rho value for all theta values. The
block quantizes the rho values to the nearest number in the rho vector. The rho vector depends
on the size of the input image and the user-specified rho resolution. The block increments a
counter (initially set to zero) in those accumulator array cells represented by the
(rho, theta) pairs found for each pixel. This process validates that
the point (row, col) is on the line defined by (rho,
theta). The block repeats this process for each logical true
pixel in the image. The Hough Transform block outputs the resulting accumulator matrix.
Extended Capabilities
Version History
Introduced before R2006a
See Also
Find
Local Maxima | Hough
Lines | hough
| houghlines
| houghpeaks