0
votes

I'm makeing an eye tracker in java with opencv but when i run this code:

CascadeClassifier eye_cascade;

try {
    face_cascade = new CascadeClassifier(PATH + "/haarcascade_frontalface_alt2.xml");
} catch (Exception e) {
    System.err.println("Face cascade not found.");
    return;
}

The compiler returns this error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0(Ljava/lang/String;)J

1

1 Answers

0
votes

Just come up that i have forgotted to import the library:

static {
    System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
}