我想从网络摄像头阅读视频,帮助python上的opencv,但我有下一个错误:
'NoneType' object has no attribute 'shape'.
在控制台中,我有:[ WARN:0] videoio(MSMF): can't grab frame. Error: -2147483638
print("starting video stream...")
vs = VideoStream(src=0).start()
time.sleep(2.0)
while True:
frame = vs.read()
frame = imutils.resize(frame, width=600) #'NoneType' object has no attribute 'shape'
if W is None or H is None:
(H, W) = frame.shape[:2]
cv2.imshow("Frame", frame)
key = cv2.waitKey(1) & 0xFF
if key == ord("q"):
break
cv2.destroyAllWindows()
vs.stop()
干草我能解决这个问题吗?谢谢!
互换的青春
当年话下
相关分类