Reputation: 407
I am using the face detection open cv for android sample.
There are no errors when building, however when deploying the sample I get runtime errors of
java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1940]: 150 could not load needed library 'libopencv_java3.so' for 'libdetection_based_tracker.so' (load_library[1095]: Library 'libopencv_java3.s0' not found)
I have added the ndk to the project, and linked the open cv library with the sample.
Upvotes: 0
Views: 2689
Reputation:
After Doing these changes Working fine.
I got Image's faces are surrounded by rectangles
Note:- 1. In Android Studio, go to File > New > Import-Module and the choose /sdk and wait for the sync to finish. 2.Do not import /sdk/java as most tutorials suggest.
Upvotes: 1
Reputation: 264
You are getting this error because android couldn't find libdetection_based_tracker.so in /jniLibs folder
solution for it is
sourceSets.main {
jni.srcDirs = [] //disable automatic ndk-build call
jniLibs.srcDir 'src/main/jniLibs'
}
buildTypes { ... } and add
defaultConfig {...
ndk{
moduleName "libdetection_based_tracker"
}
}
4.add libdetection_based_tracker.so to jniLibs
Upvotes: 0
Reputation: 345
Try to add System.loadLibrary("opencv_java3");
. It worked good for me
Upvotes: 0