I used A Beginner’s Guide to Setting up OpenCV Android Library on Android Studio as a guide to setup OpenCV in an Android Studio project. I have got the project to build and install on my phone but I am not getting a video feed from the camera (that is the JavaCameraView
is empty).
The main issues seems to be that the OpenCV Manager has been pulled from the google play store. :,(
I have tried the solution from the this SO question to try to use opencv without needing to get it off the play store, but that didn't help either.
I have all the required permissions to use use the camera on my app.
My code is pretty similar to the one from the Beginner’s Guide tutorial, but let me know if you need to see any more of my code.
My onResume:
public override fun onResume() {
super.onResume()
if (!OpenCVLoader.initDebug()) {
OpenCVLoader.initDebug()
}
loaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS)
}
BaseLoadCallback:
private val loaderCallback = object : BaseLoaderCallback(this) {
override fun onManagerConnected(status: Int) {
when (status) {
LoaderCallbackInterface.SUCCESS -> {
Log.i(TAG, "OpenCV loaded successfully")
opencv_camera_view.enableView()
opencv_camera_view.setOnTouchListener(this@MainActivity)
}
else -> {
super.onManagerConnected(status)
}
}
}
}