【发布时间】:2018-05-08 07:00:45
【问题描述】:
我在使用 beagle-bone black 无线访问 USB 摄像头时遇到问题。 首先错误是由this post解决的“选择超时”异常@
现在我在输出中面临黑屏。
这是我正在使用的测试代码。
from cv2 import *
# initialize the camera
cam = VideoCapture(0) # 0 -> index of camera
print "Cam capture"
cam.set(3,320)
cam.set(4,240)
print "Cam set"
s, img = cam.read()
print "Cam read"
if s: # frame captured without any errors
namedWindow("cam-test",CV_WINDOW_AUTOSIZE)
imshow("cam-test",img)
while True:
key = waitKey(30)
if key == ord('q') :
destroyWindow("cam-test")
我已经检查了 /dev 目录中的 video0。
【问题讨论】:
标签: python opencv video usb webcam-capture