CvCreateFileCapture in Java
How can I use CvCreateFileCapture
/ CvQueryFrame
in Java using Java wrapper?
How can I use CvCreateFileCapture
/ CvQueryFrame
in Java using Java wrapper?
Whether you working on desktop or Android? Are you going to read from file or from camera?
On Android you can only read from camera, and you should use the same VideoCapture
class: http://docs.opencv.org/java/org/opencv/highgui/VideoCapture.html . Video IO is not available. Unfortunately I don't know the current status on desktop Java, but you can try to use the same class.
Your code should be like this.
public class CapturingExample{ CvCapture capture; IplImage frame; public void Capturing() { capture = cvCreateCameraCapture(-1); if(capture!=null) { while(true) { frame = cvQueryFrame(capture); cvShowImage("heloo", frame.asCvMat()); cvSaveImage("hi.jpg", frame.asCvMat());//just saving image.. } } else System.out.println("errro"); } public static void main(final String[] args) { CapturingExample example = new CapturingExample(); example.Capturing(); } }
Here you can get some hints for converting opencv to javacv. Hints for Converting OpenCV C/C++ code to JavaCV
Asked: 2013-07-12 12:13:25 -0600
Seen: 1,892 times
Last updated: Jul 17 '13
Unresolved inclusion in OpenCV+Android tutorial
How to convert Floating point image to 32-bit single-channel?
How to translate this to Java?
android: how to put a column into Mat
OpenCV Tutorial 1 - Add OpenCV on API 8
Running the OpenCV4Android application on my PC
Using OpenCV as a stress detector