0

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?

anastaciu
  • 23,467
  • 7
  • 28
  • 53
WalleyM
  • 172
  • 7
  • Does this answer your question? [OpenCV command line app can't access camera under macOS Mojave](https://stackoverflow.com/questions/56084303/opencv-command-line-app-cant-access-camera-under-macos-mojave) – Spinkoo Aug 21 '20 at 16:41
  • Not really I’m afraid - in that one the app was not asking for camera access whereas in mine it is. The problem with mine is that it does not wait for a response to the request for access. – WalleyM Aug 21 '20 at 16:53

0 Answers0