Ask Your Question

Hough algorithm - thinning lines out

asked 2018-12-27 15:32:47 -0500

Filippo9669 gravatar image

Hello. FunctionHoughLines()returns a vector filled with these of lines which get enough votes during the voting process. Now, let's suppose: I have three lines very close to each other, so the differences in angles are very small, about 1 or 2 degree, so:

Theta = {20, 24, 25}

How can I manage to choose the one that is the most certain to be a line that I'm looking for (e.x the longest one)? To be specific: with the highest amount of votes out of these three above? What shall I compare?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-10-07 11:35:16 -0500

nicolasabril gravatar image

In c++, if you pass a Vec3f as the output vector, the third "dimension" is the amount of votes that line got. You can classify the lines using a clustering algorithm like DBSCAN and then choose only the line with the most votes inside each cluster.
Another way of deciding the angle is taking the average of the rhos and thetas of each cluster. This works better if you have a lot of lines in each cluster.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-12-27 15:32:47 -0500

Seen: 91 times

Last updated: Oct 07