Extraction of tree trunks by Hough linear detection algorithm

Source: Internet
Author: User

extraction of tree trunks by Hough linear detection algorithm

Hough linear detection is a common linear detection algorithm, the principle is relatively simple.

I will describe my understanding of the Hough Line detection algorithm: The pixel points in the image of the two-dimensional coordinates, through the transformation of the coordinate transformation to polar coordinates, and then by comparing each point in the polar coordinates of the angle value, if the angle value is the same, the same line is judged.

The algorithm has several tunable parameters:

C + +: void Houghlinesp (inputarray image, Outputarray lines, double rho, double theta, int thres Hold, double minlinelength=0, double maxlinegap=0)

    • The fifth parameter, the threshold of the int type, is the threshold parameter of the cumulative plane, which is the value that must be reached in the accumulation plane when a part is divided into a straight line in the graph. Segments greater than the threshold threshold can be detected and returned to the results.
    • The sixth parameter, the double type of minlinelength, has a default value of 0, which indicates the length of the lowest segment, which is less visible than the shorter segment of the set parameter.
    • The seventh parameter, double of type Maxlinegap, has a default value of 0, which allows the maximum distance to be connected between the same line of points and points.

To get this algorithm to power, you need to have a good understanding of these linear detection algorithms. Because of the limited level, I feel more failure to make up.

My code refers to the blog from the Mao Nebula, connected as follows:

http://blog.csdn.net/poem_qianmo/article/details/26977557

First post the original image of the tree before extraction:

The white one in the picture is the trunk that needs to be extracted. Obviously, the trunk is very unclear, the environmental disturbance is large, very bad direct separation.

I post processing of the final (because I am very food, false detection rate is higher, the missing rate is also relatively high)

The steps to complete this line detection are as follows (including image preprocessing):

1.RGB to grayscale, this step is generally nothing to note, a reminder. If the target is in a certain channel (R, G, B) and the environment is very different, it is best to retain this channel as a grayscale map. In this case, because the trunk is white, you don't have to consider this

2. Select the appropriate threshold for the binary, (the parameter selection of the domain value is very important, it must be able to remove most of the interference).

3. Delete small area connected domains. Removing some small disturbances that cannot be a trunk.

4. Trunk skeleton extraction for easy line detection.

5. Hough line detection.

Because the Hough line detection needs to adjust too many parameters, you can set the parameters to different sliders, by sliding the slider bar to find the appropriate parameters.

Extraction of tree trunks by Hough linear detection algorithm

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.