Ask Your Question

avikapl20's profile - activity

2018-04-06 08:46:29 -0500 received badge  Student (source)
2015-12-25 11:29:05 -0500 asked a question OpenCVLoader.initAsync() fails everytime

Hi, after comparing my project to the samples, I just cannot figure out why my OpenCVLoader.initAsync() method fails everytime: (This code is in my MainActivity.java)

 private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
    @Override
    public void onManagerConnected(int status) {
        switch (status) {
            case LoaderCallbackInterface.SUCCESS:
            {
                Log.i(TAG, "OpenCV loaded successfully");
            } break;
            default:
            {
                super.onManagerConnected(status);
            } break;
        }
    }
};

@Override
public void onResume()
{
    super.onResume();
    if (!OpenCVLoader.initDebug()) {
        Log.d(TAG, "Internal OpenCV library not found. Using OpenCV Manager for initialization");
        OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_1_0, this, mLoaderCallback);
    } else {
        Log.d(TAG, "OpenCV library found inside package. Using it!");
        mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
    }
}

It just cannot load the OpenCV library. I followed all of the tutorials word by word and I just don't get it.

Any help will be appreciated.