Ask Your Question
0

How do I split a contour?

asked 2017-09-18 03:49:54 -0600

Santhosh1 gravatar image

updated 2020-10-10 20:45:39 -0600

Example below shows a single detected contour. We can see that this contour can be split into two contour(red line separating the two).

First one the top curve which can be seen to represent a separate object from the bottom curve.

image description

How can I split this single contour into two separate contours at the point where the red line passes through the contour?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-09-18 04:47:24 -0600

VxW gravatar image

updated 2017-09-18 07:12:28 -0600

Hi,

  • calculate the convex hull
  • calculate for each point the normal vector
  • based on the normal vector, calculate the distances for each point to convex hull in both directions
  • split there, where the distances between hull and point is the biggest (in both directions?)

Hope it helps!

edit flag offensive delete link more

Comments

@VxW Thank You. Will try it let you know if it worked :)

Santhosh1 gravatar imageSanthosh1 ( 2017-09-18 07:00:41 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-09-18 03:49:54 -0600

Seen: 3,457 times

Last updated: Sep 18 '17