X any Y coordinates of my contours [closed]
Hello,
how can I get X and Y coordinates of my contours object in Java?
Thanks.
Hello,
how can I get X and Y coordinates of my contours object in Java?
Thanks.
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.
Asked: 2013-10-10 19:30:48 -0600
Seen: 2,123 times
Last updated: Feb 25 '14
Unresolved inclusion in OpenCV+Android tutorial
Area of a single pixel object in OpenCV
Which is more efficient, use contourArea() or count number of ROI non-zero pixels?
How to convert Floating point image to 32-bit single-channel?
Tricky image segmentation in Python
How to translate this to Java?
How to extract only top-level contours?
android: how to put a column into Mat
Duplicate: http://answers.opencv.org/question/11571/getting-a-point-from-a-contour-opencv-android/