My code (copied from https://stackoverflow.com/a/21797253/8387437) shows a mostly black screen some of the times, but works other times. I've tried uninstalling my Imaging Device, but this does not always work. I am using python 2.7.13, on a Windows 64 bit laptop. I pip installed opencv_python getting opencv_python-3.2.0.8. Here is the code: import cv2
cam = cv2.VideoCapture(0)
print cam.isOpened()
while(True):
ret, frame = cam.read()
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cam.release()
cv2.destroyAllWindows()
Here is an image of what it looks like. It switches between this frame and another similar one.
EDIT: Image wasn't inserted correctly.