Reputation: 1
64 bit,JDK 1.7,OpenCV 2.40,New version of JavaCV for the code
package test;
import static com.googlecode.javacv.cpp.opencv_core;
import static com.googlecode.javacv.cpp.opencv_highgui;
import com.googlecode.javacv.CanvasFrame;
public class Test{
public static void main(String args) {
final IplImage image = cvLoadImage("img1.png");
final CanvasFrame canvas = new CanvasFrame("Demo");
canvas.showImage(image);
canvas.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
}
}
I am getting the following error for the above code:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\BBPATIL\AppData\Local\Temp\javacpp173171889406337\jniopencv_core.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1928)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1825)
at java.lang.Runtime.load0(Runtime.java:792)
at java.lang.System.load(System.java:1059)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:418)
at com.googlecode.javacpp.Loader.load(Loader.java:368)
at com.googlecode.javacpp.Loader.load(Loader.java:315)
at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:131)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.googlecode.javacpp.Loader.load(Loader.java:334)
at com.googlecode.javacv.cpp.opencv_imgproc.<clinit>(opencv_imgproc.java:96)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.googlecode.javacpp.Loader.load(Loader.java:334)
at com.googlecode.javacv.cpp.opencv_highgui.<clinit>(opencv_highgui.java:91)
at sdmcetd.main(sdmcetd.java:11)
Java Result: 1
Please anybody help me as soon as possible..!!!!
Upvotes: 0
Views: 1972
Reputation: 859
Set your environment variables such as paths, classpaths to openCV directories. If the problem exist, download javacv-0.1.jar from internet and make it as your library.
Upvotes: 2
Reputation: 408
You can find detailed instruction at link below.
http://opencvlover.blogspot.in/2012/04/javacv-setup-with-eclipse-on-windows-7.html
Upvotes: 0