简体   繁体   English

Opencv4Android不满意的链接器错误时刻

[英]Opencv4Android Unsatisfied Linker Error Moments

I am getting the following error when I try to run my android application: 当我尝试运行我的android应用程序时出现以下错误:

java.lang.UnsatisfiedLinkError: No implementation found for double[] org.opencv.imgproc.Imgproc.moments_1(long) (tried Java_org_opencv_imgproc_Imgproc_moments_11 and Java_org_opencv_imgproc_Imgproc_moments_11__J) 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)

Here is the code where the problem is occurring: 这是发生问题的代码:

  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;
            }
        }
    }

Can anyone help me with this problem? 谁能帮助我解决这个问题? Thanks in advance! 提前致谢!

This seems to be an omission bug with some of the native libs for OpenCV 3.0 and 3.1. 对于OpenCV 3.0和3.1,某些本地库似乎是一个忽略的错误。 Until fixed, the suggested workaround is to use java code to calculate the moments. 在修复之前,建议的解决方法是使用Java代码计算矩。 See this thread . 看到这个线程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM