Possible Duplicate:
Capturing image from webcam in java?
What are the options for capturing image from webcam in java?
I know that JMF is a useful library for this, but it hasn't been updated in the past few years and I would rather not use it.
Possible Duplicate:
Capturing image from webcam in java?
What are the options for capturing image from webcam in java?
I know that JMF is a useful library for this, but it hasn't been updated in the past few years and I would rather not use it.
May be old, but it is quite reliable and simple. Give it a try!
You can find alternatives like FMJ, which is API-compatible with JMF.
Xuggle is very good too.
This JavaCV implementation works fine.
CODE:
import com.googlecode.javacv.OpenCVFrameGrabber;
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_highgui.*;
public class CaptureImage {
private static void captureFrame() {
// 0-default camera, 1 - next...so on
final OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0);
try {
grabber.start();
IplImage img = grabber.grab();
if (img != null) {
cvSaveImage("capture.jpg", img);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
captureFrame();
}
}
There is also post on viewing live video from Camera .And configuration for JavaCV : You can modify the codes and be able to save the images in regular interval and do rest of the processing you want.