简体   繁体   English

如何在Android上加载OpenCV?

[英]How to load OpenCV on Android?

I want to process images got from Gallery with OpenCV and display them on screen using functions like org.opencv.android.Utils.bitmapToMat or org.opencv.imgproc.Imgproc.cvtColor . 我想使用OpenCV处理从Gallery获得的图像,并使用org.opencv.android.Utils.bitmapToMatorg.opencv.imgproc.Imgproc.cvtColor类的函数在屏幕上显示它们。 I initialised OpenCV library functions with OpenCVLoader.initDebug() . 我使用OpenCVLoader.initDebug()初始化了OpenCV库函数。

When I want to run the application, I get the following error message: "Unfortunately * has stopped ". 当我想运行该应用程序时,出现以下错误消息: "Unfortunately * has stopped ”。

Also I have the following log messages: 另外,我有以下日志消息:

Trying to get library list
   Cannot load info library for OpenCV
   Library list: ""
   First attempt to load libs
   Trying to init OpenCV libs
   Trying to load library opencv_java
   Cannot load library "opencv_java"

Do you have any idea how to solve this error? 您知道如何解决此错误吗?

If you want to load library statically, 如果要静态加载库,

if(!OpenCVLoader.initDebug()){
    Log.d("CVerror","OpenCV library Init failure");
}else{
    // load your library and do initializing stuffs like System.loadLibrary();
}

initDebug in your onCreate() method 您的onCreate()方法中的initDebug

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

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