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° 回転させます。その後、プレビューに使用される surfaceview が作成された後、検出が開始されます。

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 に答える