2017-05-31 05:45:22 -0600 | asked a question | Capturing webcam in python I have been trying to capture my webcam in Ubuntu environment using python using the following code import numpy as np import cv2 cap = cv2.VideoCapture(0) while(True): # Capture frame-by-frame ret, frame = cap.read() When everything done, release the capturecap.release() cv2.destroyAllWindows() However, I'm getting the following error all the time File "/home/mina/untitled10.py", line 22, in <module> cv2.imshow('frame',frame) error: /root/mc-x64-2.7/conda-bld/opencv-3_1482256854890/work/opencv-3.1.0/modules/highgui/src/window.cpp:281: error: (-215) size.width>0 && size.height>0 in function imshow How can I fix that? Thank you |