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

3 answers

Sort by ยป oldest newest most voted

answered 2017-10-27 10:19:11 -0500

i was using opencv 3.3.1 as part of my app, but opencv manager 3.0.0 downloaded automatically from the play store. i had to uninstall the play store version and manually install opencv manager 3.3.1 using adb to make this error go away.

edit flag offensive delete link more


can you please explain how to install opencv 3.3.1 or higher using adb ? i can't even find the apk to install and neither a tuto ti do it.

manef gravatar imagemanef ( 2018-09-12 17:45:41 -0500 )edit

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

In step-by-step format, can you explain how you changed the OpenCV version to 3.1?

Yusaf gravatar imageYusaf ( 2017-12-30 13:14:24 -0500 )edit

Hi Yusaf. When working with android project you can just import specific version of opencv library to your project. Please see as I am sure you can figure it out by yourself if you give it some time.

PiMac gravatar imagePiMac ( 2018-01-10 02:38:52 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 2,811 times

Last updated: Aug 15 '17