简体   繁体   中英

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 . I initialised OpenCV library functions with OpenCVLoader.initDebug() .

When I want to run the application, I get the following error message: "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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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