I am using OpenCv 4.4.0 to open a camera and MacOs Mojave.
I need the app to be granted permission to access the camera. To do this I have added the NSCameraUsageDescription
key to the info-app.plist
and I know that is working since when I do try to open a camera using VideoCapture::open(0)
a dialog box asking for camera permissions does appear.
The problem is this function does not wait for the permissions to be granted and immediately fails leaving the dialog box on screen and outputting this text:
OpenCV: not authorized to capture video (status 0), requesting...
OpenCV: camera failed to properly initialize!
This leaves the dialogue box essentially useless.
Is there anyway to make the open()
function wait for the user to interact with the permissions dialogue box?