1

I'm tryng to build a little programm to capture picture from people and save them. What i'm tryng to do for now, is get the picture with a webcam using opencv library.

As i'm quite beginner, i'm just tryng here to import opencv to my project to run some tutorials i found on internet.

But when i execute this line:

 System.loadLibrary(Core.NATIVE_LIBRARY_NAME);

this error happen:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java300 in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1865)
    at java.lang.Runtime.loadLibrary0(Runtime.java:870)
    at java.lang.System.loadLibrary(System.java:1122)
    at recupphoto.RecupPhoto.main(RecupPhoto.java:26)
Java Result: 1

Here is my code:

package recupphoto;

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

public class RecupPhoto {

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

The main problem is, i guess, the way i'm dealing with libraries etc but i can't find the error. Hope you'll forgive about my poor english and help me a little! :)

edit: I've tried to adapt this tuto from eclipse to netbeans but with no more succes: http://docs.opencv.org/2.4.4-beta/doc/tutorials/introduction/desktop_java/java_dev_intro.html

Neithalf
  • 243
  • 4
  • 11

1 Answers1

1

Fixed it thanks to this tutoriel http://www.codeproject.com/Tips/717283/How-to-use-OpenCV-with-Java-under-NetBeans-IDE

By changing VM options to add native library "-Djava.library.path="C:\opencv\build\java\x86""

Neithalf
  • 243
  • 4
  • 11