Skip to content

Instantly share code, notes, and snippets.

@vo
Created July 5, 2011 15:25
Show Gist options
  • Save vo/1065053 to your computer and use it in GitHub Desktop.
Save vo/1065053 to your computer and use it in GitHub Desktop.
Capture Image to Disk
#!/usr/bin/env python
from opencv import cv
from opencv import highgui
from datetime import datetime
capture = highgui.cvCreateCameraCapture(0)
for i in range(0, 15):
img = highgui.cvQueryFrame(capture)
filename = datetime.now().strftime("%Y-%m-%d %H:%M:%S.jpg")
highgui.cvSaveImage(filename, img)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment