It takes 30 seconds to "imshow" a "VideoCapture" from USB cam. Why?

asked 2019-10-07 11:10:38 -0500

updated 2019-10-07 11:26:29 -0500

berak gravatar image

I just installed Python 3.7.4 and OpenCV-Python (using pip) on a reasonably fast desktop PC (I5, 16GB RAM). Using a UbiSoft WebCam that was meant for a Wii but appears in Device Manager as "USB camera" and works in Skype. Trying tutorial (tabs-spacing is messed up in this window; assume correct as it eventually works):

import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while(True):
    ret, frame = cap.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    cv2.imshow('video', gray)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
 cap.release()
 cv2.destroyAllWindows()

It eventually works but takes about 30 seconds to get the output video displayed.

edit retag flag offensive close merge delete

Comments

Are you Nintendo camera?

supra56 gravatar imagesupra56 ( 2019-10-08 21:39:33 -0500 )edit