Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

I want to run a face detect program in java,and get this.How can I fix it? public class DetectFace { public void Detect(){ System.out.println("Running DetectFace..."); System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath()); // CascadeClassifier faceDetector=new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1)); String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1); CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);

}

}

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Ljava/lang/String;)J at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Native Method) at org.opencv.objdetect.CascadeClassifier.<init>(CascadeClassifier.java:58) at faceDetect.DetectFace.Detect(DetectFace.java:18) at faceDetect.TestPro.main(TestPro.java:18)

click to hide/show revision 2
No.2 Revision

updated 2016-03-11 08:29:10 -0600

berak gravatar image

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

I want to run a face detect program in java,and get this.How can I fix it? it?

public class DetectFace {
    public void Detect(){
        System.out.println("Running DetectFace...");
        System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//      CascadeClassifier faceDetector=new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1));
        String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
        CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);  

 }
}

}

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Ljava/lang/String;)J at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Native Method) at org.opencv.objdetect.CascadeClassifier.<init>(CascadeClassifier.java:58) at faceDetect.DetectFace.Detect(DetectFace.java:18) at faceDetect.TestPro.main(TestPro.java:18)

faceDetect.TestPro.main(TestPro.java:18)
click to hide/show revision 3
No.3 Revision

updated 2016-03-11 09:04:23 -0600

berak gravatar image

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

I want to run a face detect program in java,and get this.How :

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

.How can I fix it?

public class DetectFace {
    public void Detect(){
        System.out.println("Running DetectFace...");
        System.out.println(getClass().getResource("lbpcascade_frontalface.xml").getPath());
//      CascadeClassifier faceDetector=new CascadeClassifier(getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1));
        String xmlfilePath=getClass().getResource("lbpcascade_frontalface.xml").getPath().substring(1);
        CascadeClassifier faceDetector = new CascadeClassifier(xmlfilePath);  

    }
}

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Ljava/lang/String;)J
    at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_1(Native Method)
    at org.opencv.objdetect.CascadeClassifier.<init>(CascadeClassifier.java:58)
    at faceDetect.DetectFace.Detect(DetectFace.java:18)
    at faceDetect.TestPro.main(TestPro.java:18)