0
我可以在Windows中运行相同的程序。我可以在Ubuntu 16.04,64位下使用lsusb查看我的相机。该相机是OSVR红外相机。在阅读webCamera时出现Ubuntu OpenCV错误
我的计划是
import numpy as np
import cv2
camera = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = camera.read()
cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('camera', frame)
# k = cv2.waitKey(30)
# When everything done, release the capture
camera.release()
cv2.destroyAllWindows()
的结果是:
[email protected]:~/project/osvrCamera$ python test.py
select timeout
select timeout
OpenCV Error: Assertion failed (!buf.empty() && buf.isContinuous()) in imdecode_, file /tmp/binarydeb/ros-kinetic-opencv3-3.1.0/modules/imgcodecs/src/loadsave.cpp, line 490
Traceback (most recent call last):
File "test.py", line 8, in <module>
ret, frame = camera.read()
cv2.error: /tmp/binarydeb/ros-kinetic-opencv3-3.1.0/modules/imgcodecs/src/loadsave.cpp:490: error: (-215) !buf.empty() && buf.isContinuous() in function imdecode_