我从源文件安装了opencv 3.1.0并尝试了示例代码 http://answers.opencv.org/question/68037/opencv-3-java-face-recognition-example-requested/。
然而,
CascadeClassifier faceDetector = new CascadeClassifier(
"/usr/local/share/OpenCV/lbpcascades/lbpcascade_frontalface.xml"
);
返回错误
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0(Ljava/lang/String;)J
at org.opencv.objdetect.CascadeClassifier.CascadeClassifier_0(Native Method)
at org.opencv.objdetect.CascadeClassifier.<init>(CascadeClassifier.java:31)
at FaceDetectorTest.main(FaceDetectorTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
我做
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
在CascadeClassifier之前并且它不会返回任何错误(看起来)