I am testing a simple open-cv example on a project hosted on FloydHub. I have installed opencv using 'pip install opencv-python'. I am trying to capture the video from web cam this way:
import cv2
cap = cv2.VideoCapture(1)
while(True):
_, frame = cap.read()
cv2.imshow('frame',frame)
if (cv2.waitKey(1) & 0xFF == ord('q')):
break
cap.release()
cv2.destroyAllWindows()
but it gives me this error: error: /io/opencv/modules/highgui/src/window.cpp:331: error: (-215) size.width>0 && size.height>0 in function imshow.
I get the same error with cv2.VideoCapture(0).
I'm trying the same example from a jupyter notebook outside of Floydhub and it works perfectly.