我想从网络摄像头阅读视频,帮助python上的opencv,但我有下一个错误:'NoneType' object has no attribute 'shape'.在控制台中,我有:[ WARN:0] videoio(MSMF): can't grab frame. Error: -2147483638print("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"): breakcv2.destroyAllWindows()vs.stop()干草我能解决这个问题吗?谢谢!
添加回答
举报
0/150
提交
取消