0

I have this C ++ OpenCV code ...

vector<Vec4i> hierarchy;
vector<vector<Point> > contours;
findContours(bin.clone(), contours, hierarchy, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_SIMPLE, Point(0, 0));

// Find the convex hull object of the external contour
vector<vector<Point> >hull( contours.size() );
for (int i = 0; i < contours.size(); i++)
{
Error here -->   convexHull(Mat(contours[i]), hull[i], false);
}

... and am using the jni to use it on an Android project, but is having a conflict in function arguments "convexHull":

"Invalid arguments ' Candidates are: void convexHull(const cv::_InputArray &, const cv::_OutputArray &, bool, bool) '" I wonder how to get around this error ... I am using OpenCV version 2.4.9

Thanks!

  • This works for me. But try with `convexHull(contours[i], hull[i], false, true);` – Miki Aug 13 '15 at 10:53
  • Thanks for listening, but still displays the same error. The error disappears when step `convexHull(Mat(contours[i]),Mat( hull[i]), false, true);` but will give an error at runtime. What I do not understand is that if I close the project and open it again, the error only appears when I open the .cpp file that contains the call. But if you do not open it, I can build the application and generate the .apk and yet still performs the convexHull normally. – João Luiz Aug 13 '15 at 17:10
  • really, because so does some calls as: `to_string (number)` `circle (...);` `putText (...);` I am looking for some solution to this problem. Thank you! – João Luiz Aug 13 '15 at 17:29

0 Answers0