throws com.googlecode.javacv.FrameGrabber.Exception,
com.googlecode.javacv.FrameRecorder.Exception {
int frameRate = 10;
// get the camera, 0 is default camera
OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0);
grabber.setFrameRate(frameRate);
grabber.start();
int numOfFrames = 0;
int maxFramesIn10Seconds = 100;
IplImage currFrame = grabber.grab();
int height = currFrame.height();
int width = currFrame.width();
try {
while (numOfFrames < maxFramesIn10Seconds) {
if (currFrame != null) {
String i = "" + numOfFrames;
if (numOfFrames < 10) {
i = "00" + numOfFrames;
} else if (numOfFrames < 100) {
i = "0" + numOfFrames;
}
String FileName = i + ".jpg";
cvSaveImage(FileName, currFrame);
numOfFrames++;
}
currFrame = grabber.grab();
}
} catch (Exception e) {
e.printStackTrace();
}
grabber.stop();
/*
* construct the MakeCheckSend object which is a facade for making the
* video from the jpg images, checking for a frame with a face in it and
* then, in a new thread, sending the video and the frame via email to
* the user .