python - 在python OpenCV中以退出代码134(被信号6:SIGABRT中断)完成的过程

标签 python opencv pycharm

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(OS:Mojave)上使用PyCharm

谢谢!

最佳答案

  • 打开/Applications/PyCharm.app/Contents/info.plist,
  • 插入新行:
  • 键:隐私-相机使用情况
  • 类型:字符串
  • 值:PyCharm中的应用程序想要使用相机。
  • 保存。
  • 重新打开PyCharm。
  • 运行您的代码。
  • 关于python - 在python OpenCV中以退出代码134(被信号6:SIGABRT中断)完成的过程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57230407/

    相关文章:

    python - 如何采样音频以进行实时处理?

    python - 带有更新标签的 Tkinter 加载屏幕

    c++ - Mat结构和memcpy的问题

    image - opencv报告图像之间的颜色差异

    python - 从 PyCharm 调试到 Visual Studio C++ 代码

    python - Azure 机器学习 Python 模块无法执行对认知服务的调用

    python - Python 中的自定义 For 循环

    c++ - vector Mat 的 opencv 切片

    python-3.x - PyCharm 没有 Splunk SDK (splunklib)

    python - 在 Pycharm IPython 控制台中绘图