Open rakeshbhatt10 opened 10 years ago
Hi @rakeshbhatt10,
Have you added opencv bin to PATH? Is this Windows or Linux? Can you post both examples you are referring to and the way of how you run them?
Yes, the frame title is incorrect. I duplicated this example from LTI-CIVIL driver and forget to change title.
Hi Sarxos,
I have added opencv bin to path which is: C:\opencv\build\x86\vc10\bin . I am currently using Windows 7.
Example to connect to webcam with JavaCV is below:
public class Demo {
public static void main(String[] args) throws Exception {
Loader.load(opencv_objdetect.class);
FrameGrabber grabber = FrameGrabber.createDefault(1);
grabber.start();
IplImage grabbedImage = grabber.grab();
CvMemStorage storage = CvMemStorage.create();
CanvasFrame frame = new CanvasFrame("Some Title", CanvasFrame.getDefaultGamma()/grabber.getGamma());
frame.setVisible(true);
while (frame.isVisible() && (grabbedImage = grabber.grab()) != null) {
cvClearMemStorage(storage);
frame.showImage(grabbedImage);
}
frame.dispose();
grabber.stop();
}
}
This example is working fine and provide me camera preview
Example with your JavaCV driver to connect with webcam is below
public class JavaCvDriverExample {
static {
Webcam.setDriver(new JavaCvDriver());
}
public static void main(String[] args) {
JFrame frame = new JFrame("LTI-CIVIL Webcam Capture Driver Example");
frame.add(new WebcamPanel(Webcam.getWebcams().get(1)));
frame.pack();
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
This code gives me unsatisfied link error : If the configuration is not right my JavaCv example should also not work. but JavaCv example is working fine
Thanks,
@sarxos How to add opencv bin to PATH
ex: my path to bin is /home/chandansr/opencv-2.4.9/build/bin
HI Sarxos,
I am currently trying to use your JavaCv driver i downloaded your JavaCv Driver project and and setup lib folder including JavaCv 0.8 jars, webcam-capture-0.3.10-RC7.jar add them into classpath. But while i run it it is giving me exception
stacktrace is below:
While the error is related to
But when i run JavaCV samples it runs fine. So if this is the linking problem JavaCv examples would not run either
I am currently using OpenCV 2.4.9 and JavaCv 0.8.
I also want to ask one more thing
You had written title of frame in example of JavaCv Driver as ":LTI-CIVIL Webcam Capture Driver Example" which is also i didn't understood if we use JavaCV it will use OpencvFFMPEGDriver or FFMPEGDriver for camera connectivity. But lit-civil will require different set of c++ header files please clarify me i am a newbie into this:
Thanks is advance Rakesh Bhatt