gpt4 book ai didi

macos - 无法在 mac 上使用 opencv 和 python 初始化 ps3 eye 但 c 示例工作正常

转载 作者:太空宇宙 更新时间:2023-11-03 21:55:31 24 4
gpt4 key购买 nike

我通过执行以下“端口安装 opencv +python27”通过 macports 安装了 OpenCV。使用 C 并调用 cvCaptureFromCAM(0) 我可以很好地从 cam 捕获帧。当我用 python 的 cv.CaptureFromCAM(0) 尝试它时,它死于以下内容:

QTKit didn't find any attached Video Input Devices!
Warning, camera failed to properly initialize!
Cleaned up camera.
Traceback (most recent call last):
File "test.py", line 5, in <module>
temp=cv.CloneImage(frame)

最佳答案

使用 python 你可以试试 cv2 接口(interface):

import cv2

# initiate the capture interface
cv2.VideoCapture() # that's right, no params

关于macos - 无法在 mac 上使用 opencv 和 python 初始化 ps3 eye 但 c 示例工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11111491/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com