Ask Your Question

How to reconnect line that has blank or curvature in the middle

asked 2017-09-15 01:21:32 -0500

jjabaram gravatar image

updated 2017-09-15 01:27:29 -0500

How to reconnect between line that has a curvature or blank in the middle of it.

image description

I'm using HoughLinesP to get the line. I'm trying to reconnect line inside green circle because the line still has another line on the other side. can anyone help me or just give me a direction to solve it.

Thank you very much.

edit retag flag offensive close merge delete


you can also try to increase the maxLineGap value in HoughLinesP or close it with morphological operations

VxW gravatar imageVxW ( 2017-09-15 02:38:21 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2017-09-15 01:51:39 -0500

Ziri gravatar image

(Suggestion) - loop over all lines one by one and compare slop with other lines . (If they have same slop and their perpendicular distance ≈ 0 ) use LineIterator -> get their points --> Use fitLine to fit those points to 1 single line .

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-15 01:21:32 -0500

Seen: 55 times

Last updated: Sep 15 '17