简体   繁体   English

Android-OpenCV模板匹配

[英]Android - OpenCV Template Matching

So I'm attempting to follow this example: OpenCV Template Matching example in Android 因此,我尝试遵循以下示例: Android中的OpenCV模板匹配示例

I'm trying to use it with the updated OpenCV Examples which I have working. 我正在尝试将其与我正在使用的更新的OpenCV示例一起使用。 The difference I'm aware of in the updated examples is how the OpenCV libraries are added. 我在更新的示例中意识到的区别是OpenCV库的添加方式。 The examples have you pull in a library project instead of a jar. 这些示例让您引入一个库项目而不是一个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 主要-http://pastebin.com/UwYRN6gN
Matching Template Class - http://pastebin.com/ankDA9MJ 匹配模板类-http://pastebin.com/ankDA9MJ
Console Error - http://pastebin.com/MmbnntSD 控制台错误-http://pastebin.com/MmbnntSD

Thanks in advance. 提前致谢。

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 : 稍微搜索一下,您会发现在加载OpenCV库之前已调用模板匹配,并在openCV论坛中看到相同的错误:

you can only call opencv functions after the BaseLoaderCallback finished(the opencv dlls were loaded). 您只能在BaseLoaderCallback完成(opencv dll已加载)后调用opencv函数。 so, if you put that code into your onCreate function, you'll get that error. 因此,如果将代码放入onCreate函数中,则会收到该错误。

you could find a complete BaseLoaderCallback documentation in openCV doc 您可以在openCV文档中找到完整的BaseLoaderCallback文档

Hope this could help you ^^ 希望这可以帮助您^^

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

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