I need to integrate OpenCV 2.4 in my app.First, I found that it requires OpenCV Manager for running app based on OpenCV. But, After some googling, I found another way using static initialization here and here. I tried but it isn't working:
psudo code:
public class MainActivity extends Activity {
static {
if (!OpenCVLoader.initDebug()) {
Log.d(TAG,"init failed")
}
}
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();
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_4, this,
mLoaderCallback);
}
}
I tried but this isn't working. It shows the same pop-up for installing openCV Manager.
I also tried to remove initAsync()
in onResume and mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS)
; but the app crashes when I use this.
Can anyone guide me to the proper way? and Please do not mark as duplicate; there are tens and hundreads of questions on SO unanswered.