Я хочу прочитать видео с веб-камеры с помощью opencv на python, но у меня следующая ошибка:
'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()
Сено я могу решить эту проблему? Спасибо!