How to extract simple geometric form from contour in opencv

I have a mat contour, and I approximate each contour with approxpolydp

Is there any way to use the contour? How do I access points in the mat profile and further simplify them (remove deformation or if two important points are so close, I can safely delete one of them)?

I'm using Java (Android) for development, so not every C / C + + method / type is available (or JNI calls are wasted)

Solution

Contour as vector > return Outline You can easily access them in C by:

vector<vector<Point> > contours;
findContours(..,contours,...);
contours.at(0).at(0) //first point of first contour

If you use mat to access them, you need to test the generated permutations But it should be easy, although I said that JNI and Android opencv are painful

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>