Find and eliminate (near-) parallel line segments
Hi,
is there are smart way to find and eliminate parallel line segments in opencv. I found some line segments using the LineSegmentDetector (LSD) of opencv. I get some results like this:
Now I want to merge these single segments into one or two segments like e.g. here (marked in red):
I have the angle, start- and endpoint and length of my linesegment. Is there are smart way to do it without iterating through all the line segments and comparing the slope and intercept of?
The linesegments are stored in a vector<Vec4f>
.
Maybe something like this: Get a single line representation for multiple close by lines clustered together in opencv?
Yeah, I found that thread after posting it here. Should work out quite well and there is even a new solution from 2 days ago that is very detailed. I will basically follow these instructions. Thanks!