Example usage for android.hardware.camera2 CaptureRequest STATISTICS_FACE_DETECT_MODE

List of usage examples for android.hardware.camera2 CaptureRequest STATISTICS_FACE_DETECT_MODE

Introduction

In this page you can find the example usage for android.hardware.camera2 CaptureRequest STATISTICS_FACE_DETECT_MODE.

Prototype

Key STATISTICS_FACE_DETECT_MODE

To view the source code for android.hardware.camera2 CaptureRequest STATISTICS_FACE_DETECT_MODE.

Click Source Link

Document

Operating mode for the face detector unit.

Whether face detection is enabled, and whether it should output just the basic fields or the full set of fields.

Possible values:

  • #STATISTICS_FACE_DETECT_MODE_OFF OFF
  • #STATISTICS_FACE_DETECT_MODE_SIMPLE SIMPLE
  • #STATISTICS_FACE_DETECT_MODE_FULL FULL

Available values for this device:
CameraCharacteristics#STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES android.statistics.info.availableFaceDetectModes

This key is available on all devices.

Usage

From source file:com.raulh82vlc.face_detection_sample.camera2.presentation.FDCamera2Presenter.java

private void updatePreview() {
    if (null == cameraDevice) {
        Log.e(TAG, "updatePreview error, return");
    }/*from w ww .  j a va  2s. c o  m*/
    captureRequestBuilder.set(CaptureRequest.STATISTICS_FACE_DETECT_MODE,
            CameraMetadata.STATISTICS_FACE_DETECT_MODE_FULL);

    try {
        cameraCaptureSessions.setRepeatingRequest(captureRequestBuilder.build(), captureCallback,
                mainThread.get());
    } catch (CameraAccessException e) {
        e.printStackTrace();
    }
}