camera.py 256 Bytes EditWeb IDE 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 #!/usr/bin/python import cv2.cv as cv import time cv.NamedWindow("camera", 1) capture = cv.CaptureFromCAM(0) while True: img = cv.QueryFrame(capture) cv.ShowImage("camera", img) if cv.WaitKey(10) == 27: break cv.DestroyAllWindows()