无法在必需资源中加载Opencv库 [英] Can not load Opencv libraries in necessitas

查看:154
本文介绍了无法在必需资源中加载Opencv库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在使用OpenCV的necessitas项目中使用摄像头。我有这个在.pro文件

I try to use the camera in a necessitas project using OpenCV. I have this on the .pro file

INCLUDEPATH += C:/OpenCV-2.3.1-android-bin/OpenCV-2.3.1/include \
                C:/OpenCV-2.3.1-android-bin/OpenCV-2.3.1/modules

LIBS += C:/OpenCV-2.3.1-android-bin/OpenCV-2.3.1/libs/armeabi/libnative_camera_r2.2.2.so \
        C:/OpenCV-2.3.1-android-bin/OpenCV-2.3.1/libs/armeabi/libnative_camera_r2.3.3.so \
        C:/OpenCV-2.3.1-android-bin/OpenCV-2.3.1/libs/armeabi/libopencv_androidcamera.a \
        C:/OpenCV-2.3.1-android-bin/OpenCV-2.3.1/libs/armeabi/libopencv_calib3d.a \ ...

当我按下这个按钮时,我调用相机:

and I call the camera when I press a button with this:

void MainWindow::on_foto_clicked()
{
    CvCapture * camera = cvCreateCameraCapture( 0 );
    IplImage * image = cvQueryFrame( camera );

    cvReleaseCapture( &camera );
}

当我运行它,它试图在设备上运行, gio与Android 2.3.4,我得到这个:

When I run it and It tries to run on the device, a samsung galaxy gio with Android 2.3.4, I get this:

W/System.err(17481): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1963]:    94 could not load needed library 'libnative_camera_r2.2.2.so' for 'libGeopei.so' (load_library[1105]: Library 'libnative_camera_r2.2.2.so' not found)

我没有加载任何库或包含?

Am I missing to load any library or include?

提前感谢

推荐答案

您需要手动复制 libnative_camera_r2.2.2.so / android / libs / armeabi-v7a 目录。

You will need to manually copy libnative_camera_r2.2.2.so to /android/libs/armeabi-v7a directory.

$ c> QtActivity.java 文件以便在启动时手动加载libs:

Then, modify the QtActivity.java file in order to load the libs manually at startup:

String appPath = getApplication().getApplicationContext().getFilesDir().getAbsolutePath(); 

//application path
System.load(appPath+"/../lib/libnative_camera_r2.3.3.so");
System.load(appPath+"/../lib/libopencv_java.so");

这篇关于无法在必需资源中加载Opencv库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆