I installed the JavaCV / OpenCV libraries and I had a problem with a basic code example.
According to a few examples that I examined, this code should load an image:
IplImage image = cvLoadImage("C:\\img.jpg");
But, when I start, I get the error "can not find the character."
Since this is my first time using it, I'm not sure if I messed up the installation or not.
According to the latest version of JavaCV, I have the correct version of OpenCV. I also imported all jar JavaCV files. As far as I can tell, I also have all the paths set correctly.
Does anyone know what the problem is?
Edit:
Full code:
import com.googlecode.javacv.CanvasFrame; import com.googlecode.javacv.cpp.opencv_core.IplImage; import java.io.File; public class demo { public static void main(String[] args) { IplImage image = cvLoadImage("C:\\img.jpg"); final CanvasFrame canvas = new CanvasFrame("Demo"); canvas.showImage(image); canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE); } }
Error trying to start it:
Exception in the main thread java.lang.RuntimeException: Uncompiled source code - Invalid sym type: cvLoadImage on javacv.demo.main (demo.java:17)
Java Result: 1
It looks like it is claiming that cvLoadImage is not accepting the string as an argument.
source share