顔検出にopencvとjavaを使用しようとしていますが、その目的でこの「JNI2OPENCV」ファイルを見つけました....しかし、それを機能させる方法について混乱しています。誰か助けてもらえますか?
http://img519.imageshack.us/img519/4803/askaj.jpg
以下はFaceDetection.javaです
class JNIOpenCV {
static {
System.loadLibrary("JNI2OpenCV");
}
public native int[] detectFace(int minFaceWidth, int minFaceHeight, String cascade, String filename);
}
public class FaceDetection {
private JNIOpenCV myJNIOpenCV;
private FaceDetection myFaceDetection;
public FaceDetection() {
myJNIOpenCV = new JNIOpenCV();
String filename = "lena.jpg";
String cascade = "haarcascade_frontalface_alt.xml";
int[] detectedFaces = myJNIOpenCV.detectFace(40, 40, cascade, filename);
int numFaces = detectedFaces.length / 4;
System.out.println("numFaces = " + numFaces);
for (int i = 0; i < numFaces; i++) {
System.out.println("Face " + i + ": " + detectedFaces[4 * i + 0] + " " + detectedFaces[4 * i + 1] + " " + detectedFaces[4 * i + 2] + " " + detectedFaces[4 * i + 3]);
}
}
public static void main(String args[]) {
FaceDetection myFaceDetection = new FaceDetection();
}
}
Netbeansでこれを機能させるにはどうすればよいですか? Google を試してみましたが、この特定のトピックに関するヘルプは非常に貧弱です。
フォルダー全体を netbeans プロジェクトの Llibrary として追加しました。ファイルを実行しようとすると、次のエラーが発生します。
Exception in thread "main" java.lang.UnsatisfiedLinkError: FaceDetection.JNIOpenCV.detectFace(IILjava/lang/String;Ljava/lang/String;)[I
at FaceDetection.JNIOpenCV.detectFace(Native Method)
at FaceDetection.FaceDetection.<init>(FaceDetection.java:19)
at FaceDetection.FaceDetection.main(FaceDetection.java:29)
Java Result: 1
BUILD SUCCESSFUL (total time: 2 seconds)
誰でもこれを操作する正確な方法を教えてもらえますか? 私がしなければならないことは何ですか?