Straight line detection by Using Hough Transform

Source: Internet
Author: User

For some dominant features in the image that conform to the parameter model, such as straight lines, circles, and ovans, we can use the parameter clustering method to extract the corresponding features.

For example, a straight line has the following parameter equation form in a polar coordinate system:

First, the parameter space is quantified as a small area with an equal interval. Then, for all edge points that exceed the given threshold, each edge point is mapped to a small area in the parameter space.
, The number falls into the number of points in each small area. Finally, take the parameters of several small regions with the maximum frequency as the line feature parameters to obtain the dominant line feature in the image.

(A) The left image is the polar coordinate representation of the image space, and the right image is the parameter space representation. (B) Each point on the line is converted to the parameter space for voting.
The algorithm flow is as follows:
1) construct a quantified parameter space. The horizontal axis is the distance from the origin to the straight line D, and the vertical axis is the inclination of the straight line. Generally, D is used.
The Quantization interval is 1 pixel, and the quantization interval is 1 degree.
2) edge extraction is performed on the input image first, and the test uses the 'yoush' operator.


3) For each vertex on the edge, In the parameter space
Then draw the corresponding curve, which is equivalent to voting for the parameters in the corresponding parameter space.
4) Select the parameter pair with the most votes as the parameter of the straight line. Here, a threshold value needs to be determined. Elements larger than the threshold value must be considered as feasible line parameters, at the same time, the local maximum value must be calculated in the parameter space. In general, the point where the parameter space meets the following two conditions can be output as a line parameter:
I. This is the local maximum.
II. The value of this point is greater than the threshold value.

The result of the test is as follows:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.