I\'m new in the world of Stackoverflow and in OpenCV programming. I\'ve made some projects with OpenCV Bindings for Java (the opencv.org officials, not JavaCV), like object
Replace
System.loadLibrary("opencv_java244");
with
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
The problem was simply that camera need time to initialize. I've added
Thread.sleep(1000);
after
VideoCapture camera = new VideoCapture(0);
I've tried this code in MacOS, and found another error.
System.loadLibrary("opencv_java244");
Above line returns this error
java.lang.UnsatisfiedLinkError: org.opencv.highgui.VideoCapture.VideoCapture_2(I)J
To overcome it, I replaced that line with this one
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
and the code works!
I'm using opencv 2.4.8, including it as user library in my eclipse project