I have python 3.7.4 and OpenCV-python 4.2.0.32. When I run this in Spyder IDE no windows pop up and it just sits there until I kill the program. I can use the same code in Jupyter Notebook and it works fine. All other features like reading images etc. work just fine. Its only when you try to use the webcam or read a mp4 file that nothing pops up in Spyder. IT works fine in Jupyter notebook. Can someone please advise what I can try out next.
I am using the standard code as below:
import cv2
cap = cv2.VideoCapture(0)
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
cv2.imshow('frame',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()