Ask Your Question
0

X any Y coordinates of my contours [closed]

asked 2013-10-10 19:30:48 -0600

lobi gravatar image

updated 2013-10-11 01:16:50 -0600

berak gravatar image

Hello,

how can I get X and Y coordinates of my contours object in Java?

Thanks.

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by Rui Marques
close date 2014-02-25 16:10:40.327701

Comments

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-02-25 15:23:02 -0600

Will Stewart gravatar image

updated 2014-02-25 15:25:07 -0600

For each contour, you can obtain a boundingRectange, which you can then get the top left and bottom right x,y coordinates. Be mindful that the tl and br might actually represent tr and bl corners!

You can then extract the bounding rectangle center based on these coordinates.

Note that a bounding rectangle center may not be the centroid of the contour (indeed, it would rarely be exactly the same and might be significantly different, especially with concave contours that are crescent-like).

If you mean x,y as in ground-plane, that is a more involved answer concerning finding a homography and performing a perspective transformation.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-10-10 19:30:48 -0600

Seen: 2,088 times

Last updated: Feb 25 '14