简体   繁体   English

OpenCV和Android Studio以及Ndk Panorama应用程序

[英]OpenCV and Android Studio and Ndk Panorama Application

i'am using Android Studio Trying to Achieve a panorama application i started with an OpenCV sample called pandorica link : https://code.google.com/archive/p/android-opencv-panorama/ 我正在使用Android Studio尝试实现全景应用程序,我从一个名为pandorica链接的OpenCV示例开始: https : //code.google.com/archive/p/android-opencv-panorama/

i set up every thing and built the project but my fonction Stitch is not found i think that ndk is not working even if it has compiled .so (shared libs) files 我设置了所有东西并构建了项目,但找不到我的功能针脚,我认为ndk即使已编译.so(共享库)文件也无法正常工作

      JNIEXPORT jint JNICALL Java_com_example_administrateur_cameraapp_MainActivity_Stitch(JNIEnv *env, jobject obj, jobjectArray args)

this is my build.gradle 这是我的build.gradle

sourceSets.main {
    jniLibs.srcDir 'src/main/libs' //set .so files location to libs
    jni.srcDirs = [] //disable automatic ndk-build call
}

// call regular ndk-build(.cmd) script from app directory
task ndkBuild(type: Exec) {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine 'C:\\\\Android\\\\android-ndk-r11b\\\\ndk-build.cmd', '-C', file('src/main/jni').absolutePath
    } else {
        commandLine 'C:\\\\Android\\\\android-ndk-r11b\\\\ndk-build', '-C', file('src/main/jni').absolutePath
    }
}

tasks.withType(JavaCompile) {
    compileTask -> compileTask.dependsOn ndkBuild
}

this is the error 这是错误

Cannot resolve corresponding JNI function Java_com_example_administrateur_cameraapp_MainActivity_Stitch 无法解析相应的JNI函数Java_com_example_administrateur_cameraapp_MainActivity_Stitch

i am using Android version 1.5.1 OpenCV 2.3.1 Gradle 2.8 Ndk r11b 我正在使用Android版本1.5.1 OpenCV 2.3.1 Gradle 2.8 Ndk r11b

My Goal is to achieve a panorama android application and I choose OpenCV 2.3.1 because opensource project used it 我的目标是实现全景android应用程序,我选择OpenCV 2.3.1,因为开源项目使用了它

If there is a tutorial of OpenCV 3.0 panorama application, Please Post the link here 如果有OpenCV 3.0全景图应用程序的教程,请在此处发布链接

I had the same problem You need to create a JNI folder inside your project and pass the needed libraries there... I had the same problem along with Imgproc.circle\\line And solved it by doing that 我遇到了同样的问题,您需要在项目内创建一个JNI文件夹,并将所需的库传递到那里...我也遇到了同样的问题,以及Imgproc.circle \\ line并通过执行此操作解决了该问题 在此处输入图片说明

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

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