我已经成功编译了opencv测试示例(videoemulation),但是在模拟器上运行它给了我一个奇怪的错误:
06-25 15:36:34.526: D/dalvikvm(621): Trying to load lib /data/data/org.siprop.opencv /lib/libopencv.so 0x405139b0
06-25 15:36:34.566: D/dalvikvm(621): Added shared lib /data/data/org.siprop.opencv/lib/libopencv.so 0x405139b0
06-25 15:36:34.566: D/dalvikvm(621): No JNI_OnLoad found in /data/data/org.siprop.opencv/lib/libopencv.so 0x405139b0, skipping init
06-25 15:36:34.619: D/VideoEmulation(621): mOpenCVAction = TRACK_SINGLE_FACE
06-25 15:36:34.627: D/VideoEmulation(621): onResume
06-25 15:36:34.627: D/VideoEmulation(621): initFaceDetect
06-25 15:36:34.637: E/CVJNI(621): Error loading cascade.
06-25 15:36:34.637: D/VideoEmulation(621): Failed to initialize face detection!
是不是我没有加载功能。请指导我。
这是 OpenCV Java 文件:
public class OpenCV {
static {
System.loadLibrary("opencv");
}
public native byte[] findContours(int[] data, int w, int h);
public native boolean createSocketCapture(String address, String port, int width, int height);
public native void releaseSocketCapture();
public native boolean grabSourceImageFromCapture();
public native byte[] getSourceImage();
public native boolean setSourceImage(int[] data, int w, int h);
public native boolean initFaceDetection(String cascadePath);
public native void releaseFaceDetection();
public native boolean highlightFaces();
public native Rect[] findAllFaces();
public native Rect findSingleFace();
}