当我尝试运行我的android应用程序时出现以下错误:
java.lang.UnsatisfiedLinkError:找不到double [] org.opencv.imgproc.Imgproc.moments_1(long)的实现(尝试过Java_org_opencv_imgproc_Imgproc_moments_11和Java_org_opencv_imgproc_Imgproc_moments_11__J)
这是发生问题的代码:
Imgproc.findContours(temp, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);
if(contours.size() > 0) {
int numObjects = contours.size();
if (numObjects < MAX_OBJECTS) {
for (int i = 0; i < contours.size(); i++) {
//moments causing unsatisfied linker error
Moments moment = Imgproc.moments((Mat)contours.get(i));
double area = moment.m00;
}
}
}
谁能帮我解决这个问题?提前致谢!
最佳答案
对于OpenCV 3.0和3.1,某些本地库似乎是一个忽略的错误。在修复之前,建议的解决方法是使用Java代码计算矩。参见this thread。