通过执行以下“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)