http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html
我完全使用本教程在我的Eclipse和Android上安装OpenCV,一切正常,除了:
我只需要面部检测,(至少现在)。
我做了一个关于这个问题的研究,这个问题已被问到很多,无法找到一个完整的,有效的解决方案或任何体面的答案。如果有完整的答案,对整个社区都有好处。以下是一些信息:
这是logcat:
11-20 16:44:15.389: I/OCVSample::Activity(27418): OpenCV loaded successfully
11-20 16:44:15.389: D/AndroidRuntime(27418): Shutting down VM
11-20 16:44:15.389: W/dalvikvm(27418): threadid=1: thread exiting with uncaught exception (group=0x415dc700)
11-20 16:44:15.399: E/AndroidRuntime(27418): FATAL EXCEPTION: main
11-20 16:44:15.399: E/AndroidRuntime(27418): java.lang.UnsatisfiedLinkError: Couldn't load detection_based_tracker from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.opencv.samples.facedetect-1.apk"],nativeLibraryDirectories=[/data/app-lib/org.opencv.samples.facedetect-1, /vendor/lib, /system/lib]]]: findLibrary returned null
11-20 16:44:15.399: E/AndroidRuntime(27418): at java.lang.Runtime.loadLibrary(Runtime.java:355)
11-20 16:44:15.399: E/AndroidRuntime(27418): at java.lang.System.loadLibrary(System.java:525)
11-20 16:44:15.399: E/AndroidRuntime(27418): at org.opencv.samples.facedetect.FdActivity$1.onManagerConnected(FdActivity.java:66)
11-20 16:44:15.399: E/AndroidRuntime(27418): at org.opencv.android.AsyncServiceHelper$1.onServiceConnected(AsyncServiceHelper.java:318)
11-20 16:44:15.399: E/AndroidRuntime(27418): at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1106)
11-20 16:44:15.399: E/AndroidRuntime(27418): at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1123)
11-20 16:44:15.399: E/AndroidRuntime(27418): at android.os.Handler.handleCallback(Handler.java:730)
11-20 16:44:15.399: E/AndroidRuntime(27418): at android.os.Handler.dispatchMessage(Handler.java:92)
11-20 16:44:15.399: E/AndroidRuntime(27418): at android.os.Looper.loop(Looper.java:137)
11-20 16:44:15.399: E/AndroidRuntime(27418): at android.app.ActivityThread.main(ActivityThread.java:5103)
11-20 16:44:15.399: E/AndroidRuntime(27418): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 16:44:15.399: E/AndroidRuntime(27418): at java.lang.reflect.Method.invoke(Method.java:525)
11-20 16:44:15.399: E/AndroidRuntime(27418): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-20 16:44:15.399: E/AndroidRuntime(27418): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-20 16:44:15.399: E/AndroidRuntime(27418): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:0)
我在Android Studio上遇到了同样的问题,尝试了所有其他答案,最后复制了libdetection_based_tracker.so文件 来自OpenCV-android-sdk / samples / face_detection / libs / armeabi-v7a 进入myProject / app / src / main / jniLibs / armeabi-7a,解决了我的问题。