pyhon opencv mojave 摄像头报错

https://blog.csdn.net/renzibei/article/details/82998933
参考了上面博主的例子,才明白。
Mac macOS 10.14 Mojave Xcode opencv 调用摄像头权限错误 This app has crashed because it attempted to access privacy-sensitive data without a usage description.
更新了macOS 10.14 Mojave之后,使用opencv调用摄像头会产生权限错误,报错This app has crashed because it attempted to access privacy-sensitive data without a usage description.
原因是macOS 10.14加入了对所有程序的隐私权限管理,如果要涉及隐私权限,要在可执行程序旁边加入Info.plist且在里面注册摄像头权限。
不过,我的是python
python 的解决办法是将,Info.plist文件复制后,放到了python的 文件夹下。我的电脑是路径是
/Users/mac/anaconda3/bin
我修改后的文件是



<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>17A405001</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>python</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>PhotoBoothLibrary.icns</string>
<key>CFBundleTypeName</key>
<string>python</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>PBLb</string>
</array>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSTypeIsPackage</key>
<true/>
<key>NSDocumentClass</key>
<string>ArchiveDocument</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>python</string>
<key>CFBundleHelpBookFolder</key>
<string>PhotoBooth.help</string>
<key>CFBundleHelpBookName</key>
<string>com.apple.PhotoBooth.help</string>
<key>CFBundleIconFile</key>
<string>PhotoBoothIcon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.apple.PhotoBooth</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>10.0</string>
<key>CFBundleName</key>
<string>python</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>10.0</string>
<key>CFBundleSignature</key>
<string>PhBo</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>1009</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>10L213p</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>10.14</string>
<key>DTSDKBuild</key>
<string>18C29</string>
<key>DTSDKName</key>
<string>macosx10.14internal</string>
<key>DTXcode</key>
<string>1000</string>
<key>DTXcodeBuild</key>
<string>10L213p</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.entertainment</string>
<key>LSMinimumSystemVersion</key>
<string>10.14</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2005–2018 Apple Inc. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>PBApplication</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<key>NSSupportsSuddenTermination</key>
<string>YES</string>
<key>Privacy - Camera Usage Description</key>
<string>YES</string>
</dict>
</plist>
最后总算能把摄像头调出来了。
pyhon opencv mojave 摄像头报错的更多相关文章
- OpenCV 官方工程报错(1) Couldn't load mixed_sample from loader
openCV/OpenCV-android-sdk/samples/tutorial-2-mixedprocessing 工程 - ::): Trying to get library list - ...
- linux环境安装opencv导入依赖报错问题
linux环境通过pip安装opencv后,导入cv2时报错: 在centos和ubuntu环境下都遇到相同的问题.报错原因: 缺少共享库 有两种解决办法: 一.使用如下命令查看缺少得共享库 yum ...
- opencv部署服务器报错
报错内容: ImportError: libSM.so.6: cannot open shared object file: No such file or directory 解决办法: sudo ...
- Win10 OpenCV3.3.0+VS2013配置大坑,OpenCV解决方案编译报错“找不到python36_d.lib”错误
今天因为想要用OpenCV做图像识别,小白一个,在网上找到一个教程,但是需要配置OpenCV3.3.0的环境,于是又在网上找OpenCV3.3.0+VS2013(因为我之前已经安过了VS2013),前 ...
- 关于eclipse 与OpenCV 配置频繁报错的问题总结Program "C:/SDK/android-ndk-xxx/ndk-build.cmd" is not found in PATH报错的解决!
2018-01-3116:58:12 Program "C:/SDK/android-ndk-r8/ndk-build.cmd" is not found in PATH 今天这一 ...
- macOS seria 10.12升级到macOS Mojave的报错:xcrun: error: invalid active developer path, missing xcrun
今天升级mac系统到macOS mojave后,在终端操作gitlab时遇到一行莫名其妙的错误: xcrun: error: invalid active developer path (/Libra ...
- Android OpenCV样例调试+报错处理
1.OpenCV样例调试:<OpenCV Sample - image-manipulations> blog+报错:E/CAMERA_ACTIVITY(17665): Cam ...
- Pycharm安装opencv与 无法安装PIL以及安装Pillow之后依然报错的解决办法
Pycharm 安装opencv pycharm里自带了很方便的安装第三方库的方法,不需要自己去下载opencv包再pip install 在pycharm的File/Settings/Project ...
- windows下编译caffe报错:error MSB4062: 未能从程序集 E:\NugetPackages\OpenCV.2.4.10\......的解决办法
参考博客:http://blog.csdn.net/u013277656/article/details/75040459 在windows上编译caffe时,用vs打开后会自动加载还原NugetPa ...
随机推荐
- Gamma阶段第五次scrum meeting
每日任务内容 队员 昨日完成任务 明日要完成的任务 张圆宁 #91 用户体验与优化https://github.com/rRetr0Git/rateMyCourse/issues/91(持续完成) # ...
- UE运行sas配置-WIN10
1.在UE中配置SAS运行的工具: UE--高级---用户工具--工具配置 在命令行输入"D:\soft\SASHome\SASFoundation\9.4\sas.exe" -c ...
- JPA连接PG数据库时间类型查询报错的修改
PG数据库中的时间格式规范: https://blog.csdn.net/sky_limitless/article/details/79527665 to_data 转换为 普通的时间格式 to_t ...
- Shared variable in python's multiprocessing
Shared variable in python's multiprocessing https://www.programcreek.com/python/example/58176/multip ...
- 均值为1的独立指数随机Y1,Y2,组合成的Y=Y1-(Y2-1)^2/2 在Y>0的条件下也是指数随机变量
均值为1的独立指数随机Y1,Y2,组合成的Y=Y1-(Y2-1)^2/2 在Y>0的条件下也是指数随机变量 另一个条件分布 13题有错误,应该是P{x<X<x+dx,y<Y& ...
- rabbitMQ消息队列 – Message方法解析
消息的创建由AMQPMessage对象来创建$message = new AMQPMessage("消息内容");是不是很简单. 后边是一个数组.可以对消息进行一些特殊配置$mes ...
- github加速
访问 https://www.ipaddress.com/ 找到以下网址对应的ip,在本地hosts里面映射,或者到路由器内映射好即可. github.com assets-cdn.github.co ...
- Android 使用NDK编译二进制文件并运行
Android 使用NDK编译二进制文件并运行本文介绍如何编译可以在Android平台上运行的二进制可执行文件. 首先我们,知道,Android是基于Linux的,而在Linux上,可以执行二进制文件 ...
- IfcDirection
The IfcDirection provides a direction in two or three dimensional space depending on the number of D ...
- 如何利用maven将本地jar包引入到工程之中
1.在个人开发模式下,可以将jar包放入项目的lib目录中,在pom.xml中做如下配置: <dependencies> <dependency> <groupId> ...