CvInvoke.cvContourArea in c#, Emgu
Hi, I am using C# to find the area within a contour and need help translating c/c++ code as found in the following example: Unfortunately, C#, Emgu does not support vectors.
vector<Point> contour;
contour.push_back(Point2f(0, 0));
contour.push_back(Point2f(10, 0));
contour.push_back(Point2f(10, 10));
contour.push_back(Point2f(5, 4));
double area0 = contourArea(contour);
vector<Point> approx;
approxPolyDP(contour, approx, 5, true);
double area1 = contourArea(approx);
cout << "area0 =" << area0 << endl <<
"area1 =" << area1 << endl <<
"approx poly vertices" << approx.size() << endl;
Thx, Fred.
Since @Luca Del Tongo has made the effort to post an answer I will keep it open for some replying. However, keep in mind that EmguCV is not an official supported OpenCV package and that questions about it should be posted at the correct supporting EmguCV forum.
Given that it was quite simple to reply to this question I did it :-) Feel free to delete it as it's not related to opencv and break site rules...