Displaying a webcam feed using OpenCV and Python
I have been trying to create a simple program with Python which uses OpenCV to get a video feed from my webcam and display it on the screen. I know I am partly there because the window is created and the light on my webcam flicks on, but it just doesn't seem to show anything in the window. Hopefully someone can explain what I'm doing wrong. import cv cv.NamedWindow("w1", cv.CV_WINDOW_AUTOSIZE) capture = cv.CaptureFromCAM(0) def repeat(): frame = cv.QueryFrame(capture) cv.ShowImage("w1", frame) while True: repeat() On an unrelated note, I have noticed that my webcam sometimes changes its index