Getting single frames from video with python
I am just getting started on using OpenCV using Python, and I will work with video. I have established connection to the web camera, using the script below. Now I would like to take out a couple of frames that can be analyzed. Is there some one who can help me get started on that?
I have the following code:
import cv2.cv as cv
import time
from scipy import *
import numpy
import sys, os, random, hashlib
from math import *
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()