1
09-17 14:06:18.128: A/libc(27454): Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1)

每当我的应用程序似乎识别出一张脸时,就会弹出这个可爱的错误。

代码:

private void startFaceDetection() {
    // Try starting Face Detection
    Camera.Parameters params = mCamera.getParameters();

    // start face detection only *after* preview has started
    if (params.getMaxNumDetectedFaces() > 0) {
        // camera supports face detection, so can start it:
        mCamera.startFaceDetection();
    }
}

@Override
public void onResume() {
    super.onResume();
    mCamera = Camera.open();
    mCamera.setFaceDetectionListener(this);
    mCamera.setDisplayOrientation(90);
}

在surfaceCreated、surfaceChanged中我开始人脸检测。

有谁知道为什么会这样?难道我做错了什么?

打开相机,设置检测侦听器,将相机旋转 90°,使我处于纵向,然后创建用于预览的表面视图后开始检测。

4

1 回答 1

0

这里的链接可能会对您有所帮助,这是我找到的关于人脸检测的最佳教程。 http://www.edumobile.org/android/android-programming-tutorials/face-detection-example-tutorials-in-android/http://trivedihardik.wordpress.com/2011/09/13/android-face -检测示例/

于 2013-02-13T10:48:48.063 回答