Ask Your Question

Android Canny problem No implementation found

asked 2017-08-11 10:11:24 -0500

PiMac gravatar image

updated 2017-09-10 16:31:16 -0500


I am trying to modify application "Second sight" from the book Android Application Programming with OpenCV 3 first camera (app works fine ). (Android 7.0 OpenCV 3.3 ) I am using

            this, mLoaderCallback);

to load the library. Everything works (Mat, imgproc.cvtcolor) except imgproc.Canny (possibly more) When I call

Imgproc.Canny(img, edges, 30, 200);

I get

java.lang.UnsatisfiedLinkError: No implementation found for void org.opencv.imgproc.Imgproc.Canny_3(long, long, double, double) (tried Java_org_opencv_imgproc_Imgproc_Canny_13 and Java_org_opencv_imgproc_Imgproc_Canny_13__JJDD)

Why is it not working? Please help.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2017-08-13 03:56:24 -0500

sleo5 gravatar image

It seems your parameter's type are wrong. the error message report you used long values, i'm not sure that it is correct. What is the type of img and edges in your code?

You should have something like that in your code:

Mat img = new Mat(); // img it's not a long value but a matrix
edit flag offensive delete link more


Unfortunately I think it is not the problem. My code is:

public List<MatOfPoint> biggestContourSegmentation(Mat img) {
    edges = new Mat();
    Imgproc.Canny(img, edges, 30.0, 200.0);

I do believe that it uses

//javadoc: Canny(image, edges, threshold1, threshold2)
public static void Canny(Mat image, Mat edges, double threshold1, double threshold2)

    Canny_3(image.nativeObj, edges.nativeObj, threshold1, threshold2);


form Imgproc package and the native class that java calls is actually taking long values:

private static native void Canny_3(long image_nativeObj, long edges_nativeObj, double threshold1, double threshold2);
PiMac gravatar imagePiMac ( 2017-08-13 13:19:09 -0500 )edit

answered 2017-08-15 02:59:36 -0500

PiMac gravatar image

Changed OpenCV to 3.1 version and canny works again.

edit flag offensive delete link more


Thanks. Same for me. Doesn't work in 3.2.0 either.

stephen-mhc gravatar imagestephen-mhc ( 2017-09-06 03:21:51 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-08-11 10:11:24 -0500

Seen: 185 times

Last updated: Aug 15