windows, eclipse, java and openCV-245

asked 2013-05-01 05:01:06 -0600

keltik gravatar image

updated 2013-05-01 05:31:30 -0600

Hi, I am following the instructions on this page for installation of openCV:

http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html#create-a-simple-java-project-in-eclipse

But it doesn't work. I cant execute the example code.

import org.opencv.core.CvType;
import org.opencv.core.Mat;

public class Main {
public static void main(String[] args) {
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
    Mat m  = Mat.eye(3, 3, CvType.CV_8UC1);
    System.out.println("m = " + m.dump());
 }
}

I need openCV to do some motion detection on image-series, but i am too stupid to import openCV-2.4.5 properly.

The console output shows this message:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java244 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at camStatisticsTests.RawTests.main(RawTests.java:20)

What am i doing wrong ?

edit retag flag offensive close merge delete

Comments

someone edited the tutorial, but it still doesn't work, same error.

keltik gravatar imagekeltik ( 2013-05-01 05:30:29 -0600 )edit

Actually i found a solution myself: The Tutorial doesn't show that the dll inside the path "opencv\build\java\x86" has to be attached to the jar. The editors should update this. It leads to confusion.

keltik gravatar imagekeltik ( 2013-05-01 06:17:35 -0600 )edit