2

通过执行以下“port install opencv +python27”,我已经通过 macports 安装了 OpenCV。使用 C 并调用 cvCaptureFromCAM(0) 我可以很好地从摄像头捕获帧。当我使用 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)
4

1 回答 1

-1

使用 python 你可以尝试cv2接口:

import cv2

# initiate the capture interface
cv2.VideoCapture() # that's right, no params
于 2013-01-22T02:39:37.047 回答