将MacBook升级到MacOS Mojave之后不久,我的OpenCV程序就被破坏了。
安装了以下组合,似乎没有任何效果。
Python 3.6.5 with OpenCV 3.4.1
Python 3.7.0 with OpenCV 3.4.3
简单的测试程序
import cv2
vid = cv2.VideoCapture(0)
while True:
_, frame = vid.read()
cv2.imshow("Frame", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
vid.release()
cv2.destroyAllWindows()
崩溃日志的一部分(完整日志请单击此处)
Process: Python [23472]
Path: /usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier: Python
Version: 3.7.0 (3.7.0)
Code Type: X86-64 (Native)
Parent Process: zsh [22997]
Responsible: Python [23472]
User ID: 501
Date/Time: 2018-10-09 14:39:32.725 +0800
OS Version: Mac OS X 10.14 (18A391)
Report Version: 12
Anonymous UUID: D946F646-E90A-A450-14FB-63EA96A4C90E
Time Awake Since Boot: 18000 seconds
System Integrity Protection: disabled
Crashed Thread: 3 Dispatch queue: com.apple.root.default-qos
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace TCC, Code 0x0
根据@wm的建议,显然,最新的macOS变体已在所有应用程序之上注入了紧密的安全层。
现在,当且仅当我使用本机Terminal应用程序时,我才可以调用相机。希望iTerm会尽快推出更新。
干杯!
更新(6/11/2018):iTerm发布了一个更新,它将要求相机许可。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句