Issue
I have written a tutorial for setting up OpenCV 4.1.0 for Android with NDK support. The tutorial is hosted on this Github repository. When trying to apply these instructions to Opencv 4.1.1 version, I get a black screen. What do I need to change to make it work for OpenCV 4.1.1?
Solution
OpenCV 4.1.1 is permissions-aware. In MainActivity.kt, you need
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
if (requestCode == 1 && grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
mOpenCvCameraView!!.setCameraPermissionGranted()
}
}
Answered By - Alex Cohn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.