1

So I'm attempting to follow this example: OpenCV Template Matching example in Android

I'm trying to use it with the updated OpenCV Examples which I have working. The difference I'm aware of in the updated examples is how the OpenCV libraries are added. The examples have you pull in a library project instead of a jar.

The error I'm getting is this.

02-19 09:19:19.340: E/AndroidRuntime(390): FATAL EXCEPTION: main
02-19 09:19:19.340: E/AndroidRuntime(390): Process: com.example.opencv_templatematching, PID: 390
02-19 09:19:19.340: E/AndroidRuntime(390): java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.highgui.Highgui.imread_1(java.lang.String) (tried Java_org_opencv_highgui_Highgui_imread_11 and Java_org_opencv_highgui_Highgui_imread_11__Ljava_lang_String_2)
02-19 09:19:19.340: E/AndroidRuntime(390):  at org.opencv.highgui.Highgui.imread_1(Native Method)
02-19 09:19:19.340: E/AndroidRuntime(390):  at org.opencv.highgui.Highgui.imread(Highgui.java:362)
02-19 09:19:19.340: E/AndroidRuntime(390):  at com.example.opencv_templatematching.MatchingDemo.run(TemplateMatching.java:18)
02-19 09:19:19.340: E/AndroidRuntime(390):  at com.example.opencv_templatematching.TemplateMatching.main(TemplateMatching.java:58)

Full Code:
Main - http://pastebin.com/UwYRN6gN
Matching Template Class - http://pastebin.com/ankDA9MJ
Console Error - http://pastebin.com/MmbnntSD

Thanks in advance.

Mytheral
  • 3,929
  • 7
  • 34
  • 57
  • 1
    you fail to initialize the opencvmanager, no native so's are loaded. please look at the examples in the opencv4android sdk. also, you can't call opencv code in onCreate (too early) – berak Feb 19 '15 at 16:13
  • 1
    the examples you show are either c++ or desktop java. please be more careful there – berak Feb 19 '15 at 16:15

1 Answers1

1

googling a little bit , you will found that you've called the template matching before loading the OpenCV library see the same error in openCV forum :

you can only call opencv functions after the BaseLoaderCallback finished(the opencv dlls were loaded). so, if you put that code into your onCreate function, you'll get that error.

you could find a complete BaseLoaderCallback documentation in openCV doc

Hope this could help you ^^

Yahya
  • 501
  • 4
  • 8