0

I'm learning OpenCV, and need to access the input from the webcam using VideoCapture(0). Unfortunately, I'm not getting anything from the webcam.

I'm unsure if this is a bug with Spyder, or an issue with my code.

My code reads -

cap = cv2.VideoCapture(0)
while (1):
    _, frame = cap.read()
    display(frame)

Display is a tried-and-true function that displays a picture.

Does anyone know what my issue might be?

EDIT - This is an issue with Spyder's implementation, so although it wasn't displaying, I was in fact getting input from the webcam.

Sam Carpenter
  • 377
  • 3
  • 16
  • 1
    I dont thing it is spyder, you must wait for the camera to generate the next picture, like in here: https://stackoverflow.com/questions/2601194/displaying-a-webcam-feed-using-opencv-and-python – Victor Jul 23 '17 at 23:11
  • 1
    Personally I am using Spyder too (with the ipython console) and I have no problem to grab a camera frame. However, I cannot display frames / images / plot from any Python debugger, and this is known issue. – Vincent Vidal Jul 24 '17 at 09:54

0 Answers0