JavaCV Android Studio可以吗

我正在尝试使用JavaCV与Android Studio和Gradle.我写了这样的代码片段:

   repositories {
    mavenCentral()
    maven {
        url "http://maven2.javacv.googlecode.com/git/"
    }
}

dependencies {
    compile files('libs/android-support-v4.jar')
    compile group: 'com.googlecode.javacpp', name: 'javacpp', version: '0.5'
    compile group: 'com.googlecode.javacv', name: 'javacv', version: '0.5'
}

我在dir外部库中看到导入的库.所以我试图运行这个:

...
  IplImage zdjecie=cvLoadImage(Environment.getExternalStorageDirectory().getPath()+ "/1.bmp");
    cvSaveImage(Environment.getExternalStorageDirectory().getPath()
    + "/2.bmp", zdjecie);
...

我有错误:

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load jniopencv_core: findLibrary returned null

…因为我不知道应该怎么用opencv(和其他).so文件.

那么我们应该如何在Android Studio中使用JavaCV?

最佳答案
插入build.gradle依赖关系为我工作:

compile ‘org.bytedeco:javacv:+’
compile group: ‘org.bytedeco.javacpp-presets’, name: ‘opencv’, version:   ‘2.4.10–0.10', classifier: ‘android-arm’ 
compile group: ‘org.bytedeco.javacpp-presets’, name: ‘ffmpeg’, version:   ‘2.5.1–0.10', classifier: ‘android-arm’

转载注明原文:JavaCV Android Studio可以吗 - 代码日志