Ask Your Question
0

How to Close open contours [closed]

asked 2018-02-17 10:34:55 -0600

dursunsefa gravatar image

I want to close the open contours like the picture :

image description

And I want to close the open contour as shown in the picture and make it a single contour (single shape) . (Different colors in the picture show different contours).

:image description

How can I do that?

I've tried the approxPoly , but did not succeed.

edit retag flag offensive reopen merge delete

Closed for the following reason question is off-topic or not relevant by dursunsefa
close date 2018-05-03 10:51:42.301704

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-02-19 03:21:03 -0600

Erosion and dilation are your friend here, combined with the convex hull operator. This will allow you to close the small gap at the top of the E, thus returning a contour around the line and not around the object itself. Have a look at the morphological operations tutorials, here and here.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-02-17 10:34:55 -0600

Seen: 3,382 times

Last updated: Feb 17 '18