无法加载在necessitas opencv的库 [英] Can not load Opencv libraries in necessitas

查看:185
本文介绍了无法加载在necessitas 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 \ ...

和我所说的相机时,我preSS一个按钮这样的:

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 );
}

当我运行它,它试图将设备,三星Galaxy GIO的Andr​​oid 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 /安卓/库/ armeabi-V7A 目录。

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

然后,修改 QtActivity.java 文件,以便在启动时手动加载库:

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");

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

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