Код: Выделить всё
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while True :
ret,frame = cap.read()
print(frame)
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
Код: Выделить всё
None
OpenCV(3.4.1) Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /tmp/opencv-20180307-44253-2moj1c/opencv-3.4.1/modules/highgui/src/window.cpp, line 356
Traceback (most recent call last):
File "video_cap_opencv.py", line 11, in
cv2.imshow('frame',frame)
cv2.error: OpenCV(3.4.1) /tmp/opencv-20180307-44253-2moj1c/opencv-3.4.1/modules/highgui/src/window.cpp:356: error: (-215) size.width>0 && size.height>0 in function imshow
Подробнее здесь: https://stackoverflow.com/questions/493 ... era-opencv
Мобильная версия