Android.Hardware.Camera.StartFaceDetection Method
Starts the face detection.

Syntax

[Android.Runtime.Register("startFaceDetection", "()V", "")]
public void StartFaceDetection ()

See Also

Camera.StopFaceDetection

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif the face detection is unsupported.
Java.Lang.RuntimeExceptionif the method fails or the face detection is already running.

Remarks

Starts the face detection. This should be called after preview is started. The camera will notify NoType:android/hardware/Camera$FaceDetectionListener;Href=../../../reference/android/hardware/Camera.FaceDetectionListener.html of the detected faces in the preview frame. The detected faces may be the same as the previous ones. Applications should call Camera.StopFaceDetection to stop the face detection. This method is supported if NoType:android/hardware/Camera$Parameters;Href=../../../reference/android/hardware/Camera.Parameters.html#getMaxNumDetectedFaces() returns a number larger than 0. If the face detection has started, apps should not call this again.

When the face detection is running, NoType:android/hardware/Camera$Parameters;Href=../../../reference/android/hardware/Camera.Parameters.html#setWhiteBalance(java.lang.String), NoType:android/hardware/Camera$Parameters;Href=../../../reference/android/hardware/Camera.Parameters.html#setFocusAreas(java.util.List<android.hardware.Camera.Area>), and NoType:android/hardware/Camera$Parameters;Href=../../../reference/android/hardware/Camera.Parameters.html#setMeteringAreas(java.util.List<android.hardware.Camera.Area>) have no effect. The camera uses the detected faces to do auto-white balance, auto exposure, and autofocus.

If the apps call Camera.AutoFocus(.IAutoFocusCallback), the camera will stop sending face callbacks. The last face callback indicates the areas used to do autofocus. After focus completes, face detection will resume sending face callbacks. If the apps call Camera.CancelAutoFocus, the face callbacks will also resume.

After calling Camera.TakePicture(.IShutterCallback, .IPictureCallback, .IPictureCallback) or Camera.StopPreview, and then resuming preview with Camera.StartPreview, the apps should call this method again to resume face detection.

[Android Documentation]

Requirements

Namespace: Android.Hardware
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 14