Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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: image description

Now I want to merge these single segments into one or two segments like e.g. here (marked in red): image description image description

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>.

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: image descriptionImage 1a

Image 2a

Now I want to merge these single segments into one or two segments like e.g. here (marked in red): image descriptionImage 1b image descriptionImage 1c

Image 2b

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>.