我想從網絡攝像頭閱讀視頻,幫助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
提交
取消