我正在使用安装了OpenCV 2.4的Python绑定以及以下说明.
我的问题与此类似,但我需要Windows机器解决方案.
问题:当我尝试使用时
cap = cv2.VideoCapture(0)
print cap.grab()
Run Code Online (Sandbox Code Playgroud)
它工作正常,但以下代码
cap = cv2.VideoCapture(filename)
print cap.grab()
Run Code Online (Sandbox Code Playgroud)
总是返回False.
文件的路径是正确的,绝对的,没有空格.
我试用了两台装有Windows XP和Windows 7的机器,结果相似.在Linux(Ubuntu)上,它对我来说很好.