gpt4 book ai didi

c++ - Mac Mojave 上的 OpenCV C++ Xcode 错误 NSCameraUsageDescription

转载 作者:太空宇宙 更新时间:2023-11-04 12:42:53 25 4
gpt4 key购买 nike

我已经在 MacPro 上安装了 opencv,我正在尝试编写一个程序来激活 cam,它只是为了测试它成功构建的 opencv,但是,cam 没有打开,我收到了这条消息

saved enable noise cancellation setting is the same as the default(=1) pentest[30782:364297] [access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data

我的代码是:

#include <iostream>
#include<opencv2/opencv.hpp>
using namespace cv;
int main(int argc, const char * argv[]) {
// insert code here...
VideoCapture cap(0);
while(true){
Mat Webcam;
cap.read(Webcam);
imshow("webcam",Webcam);
}
return 0;
}

最佳答案

我最近发布了 another answer解决这种情况:

Put the Info.plist file with the desired NSCameraUsageDescription, NSMicrophoneUsageDescription (or others) with the assembled file from XCode (See screenshots below). For the Release and Debug versions.

关于c++ - Mac Mojave 上的 OpenCV C++ Xcode 错误 NSCameraUsageDescription,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53253563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com