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 摄像头报错的更多相关文章

  1. OpenCV 官方工程报错(1) Couldn't load mixed_sample from loader

    openCV/OpenCV-android-sdk/samples/tutorial-2-mixedprocessing 工程 - ::): Trying to get library list - ...

  2. linux环境安装opencv导入依赖报错问题

    linux环境通过pip安装opencv后,导入cv2时报错: 在centos和ubuntu环境下都遇到相同的问题.报错原因: 缺少共享库 有两种解决办法: 一.使用如下命令查看缺少得共享库 yum ...

  3. opencv部署服务器报错

    报错内容: ImportError: libSM.so.6: cannot open shared object file: No such file or directory 解决办法: sudo ...

  4. Win10 OpenCV3.3.0+VS2013配置大坑,OpenCV解决方案编译报错“找不到python36_d.lib”错误

    今天因为想要用OpenCV做图像识别,小白一个,在网上找到一个教程,但是需要配置OpenCV3.3.0的环境,于是又在网上找OpenCV3.3.0+VS2013(因为我之前已经安过了VS2013),前 ...

  5. 关于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 今天这一 ...

  6. 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 ...

  7. Android OpenCV样例调试+报错处理

    1.OpenCV样例调试:<OpenCV Sample - image-manipulations>       blog+报错:E/CAMERA_ACTIVITY(17665): Cam ...

  8. Pycharm安装opencv与 无法安装PIL以及安装Pillow之后依然报错的解决办法

    Pycharm 安装opencv pycharm里自带了很方便的安装第三方库的方法,不需要自己去下载opencv包再pip install 在pycharm的File/Settings/Project ...

  9. windows下编译caffe报错:error MSB4062: 未能从程序集 E:\NugetPackages\OpenCV.2.4.10\......的解决办法

    参考博客:http://blog.csdn.net/u013277656/article/details/75040459 在windows上编译caffe时,用vs打开后会自动加载还原NugetPa ...

随机推荐

  1. [技术博客] 自制 apt deb Repository

    [技术博客] 自制 apt deb Repository (termux) 在修改整合遵循GPLv3的Android terminal app and Linux environment:termux ...

  2. Linux-Centos学习笔记

    Linux目录结构: 只有1个目录,根目录 usr:相当于program files etc:存放系统配置文件 root:系统管理员默认目录 home:存放其他用户的目录 pwd: 打印当前目录 cd ...

  3. 用shedlock实现分布式定时任务锁

    添加包 <dependency>     <groupId>net.javacrumbs.shedlock</groupId>     <artifactId ...

  4. pygis库组件安装相关问题

    python -m pip install --upgrade pip

  5. MLflow系列4:MLflow模型

    英文链接:https://mlflow.org/docs/latest/models.html 本文链接:https://www.cnblogs.com/CheeseZH/p/11946260.htm ...

  6. 微信小程序 获取地理位置信息

    app.json "permission":{ "scope.userLocation": { "desc": "你的位置信息将用 ...

  7. TortoiseSVN is locked in another working copy

    TortoiseSVN提交报错 TortoiseSVN is locked in another working copy原因:可能是因为打开了多个commit会话,然后又去修改了提交文件的内容,导致 ...

  8. PHP Y2K38 (2038年) 问题

    PHP 的 strtotime('2100-01-01'); 转换失败:经查询是因为32位系统的 Y2K38问题: Y2K38 问题:当时间大于 2038年01月19日03:14:07 时,strto ...

  9. linux查看实时日志命令

    tail -f localhost_access_log.2018-12-11.txt(当前时间)今天的实时日志,操作一下系统,就会报出相应的日志

  10. 修改Window服务器虚拟内存位置

    系统采用的是windows server2008操作系统,硬件部门在分配磁盘的时候C盘只有50G,其中虚拟内存就占用了30G,再除去操作系统占用空间,可用自由支配空间较小,会出现在部分异常情况下C盘占 ...