macOS opencv调用摄像头出错[AVCaptureDevice authorizationStatusForMediaType:]

         在MacOS上,使用opencv(C++)调用摄像头,"VideoCapture capture(0);",报出如下错误:

[AVCaptureDevice authorizationStatusForMediaType:]: unrecognized selector sent to class 0x7fff9dd426a0

[ERROR:0] VIDEOIO(AVFOUNDATION): raised unknown C++ exception!

         后用Python运行摄像头调用正常,证明不是权限问题。google后发现有人遇到的问题是用opencv2正常,opencv4报此错误,于是乎,怀疑是版本问题,我电脑上装了2和4两个版本,果然编译时使用opencv2调用摄像头正常了。

你可能感兴趣的:(编译,图像处理)