简体   繁体   中英

Opencv4Android Unsatisfied Linker Error Moments

I am getting the following error when I try to run my android application:

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)

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. Until fixed, the suggested workaround is to use java code to calculate the moments. See this thread .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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