0

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?

j0k
  • 22,600
  • 28
  • 79
  • 90
adrian2012
  • 17
  • 1
  • 6

1 Answers1

0

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

Dan Lee
  • 126
  • 1
  • 4
  • Appreciate this answer, but as title of question you should add some more details for: `How to load OpenCV on Android?` as [HERE](https://stackoverflow.com/a/27421494/5737774). – fWd82 Jun 19 '18 at 07:06