【发布时间】:2019-12-05 09:51:24
【问题描述】:
考虑:
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Display the resulting frame
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# When everything done, release the capture
cap.release()
cv2.destroyAllWindows()
我在 PyCharm IDE 中使用 Python 和 OpenCV。当我尝试使用 OpenCV 打开网络摄像头时,出现以下错误:
进程以退出代码 134 结束(被信号 6:SIGABRT 中断)
发生这种情况是因为我的内存不足了吗? 有什么解决办法?
我在 MacBook Pro 上使用 PyCharm(操作系统:macOS v10.14 (Mojave))。
【问题讨论】:
-
@Eskapp 上面的问题是由于苹果拒绝授予访问网络摄像头的权限而发生的,这个问题还有其他解决方案吗?
-
The underlying reason may be an assert。 134 肯定是asserts 的一个非常常见的退出代码。