Capture Options in Selfie Capture SDK for Android

Capture Modes

When initializing a capture session, the SelfieCaptureOptions setting determines the capture mode. You can choose between two capture modes:

  • Manual Capture: During a manual capture, the user must tap the screen in order to begin the capture process.

    • When this mode is configured, text will be displayed on screen prompting the user to tap to capture when ready. Set the enableAutoCapture setting to false configure manual capture:

      Copy
      val options = SelfieCaptureOptions(enableAutoCapture = false)
  • Auto Capture: During an auto capture, the user must position their face in the frame. The capture process then begins automatically. This is the default.

    • The SDK continuously processes camera frames through an image-processing pipeline, checking things such as motion, blur, glare, etc. Once a frame passes these checks, then the image is captured automatically.

    • There is a configurable timeout value. Once the timeout is reached, the user is presented with an alert that allows them to select their capture mode and reattempt. Use the autoCaptureTimeout setting to configure the length of the timeout.

      Copy
      // Timeout is in seconds
        val options = SelfieCaptureOptions(enableAutoCapture = true, autoCaptureTimeout = 10)

Camera Selection

Selfie Capture for Android uses the front facing camera by default but also supports back camera capture. This is especially useful in scenarios such as a retail environment where an employee is handling the device to capture the customer's photo.

Set the cameraOption setting to SelfieCameraOption.Back to enable back camera capture:

Copy
// Timeout is in seconds
val options = SelfieCaptureOptions(enableAutoCapture = true, autoCaptureTimeout = 10, cameraOption = SelfieCameraOption.Back)