Capture Modes

When initializing a capture session, you can choose between three capture modes: Manual Capture, Semi-Auto Capture, and Auto Capture. This is configured via CFASelfieSettings.captureMode and CFAFarSelfieSettings.captureMode, which are defaulted to .Semi_Auto.

Manual Capture

Manual Capture mode requires user interaction for the selfie to be captured. When this mode is configured, text will be displayed on screen prompting the user to tap when ready.

let settings = CFASelfieSettings()

// Near selfie capture mode
settings?.captureMode = .ManualCapture

// Far selfie capture mode
settings?.objFarSelfieSettings.captureMode = .ManualCapture

Auto Capture

With this mode enabled, 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.

let settings = CFASelfieSettings()

// Near selfie capture mode
settings?.captureMode = .AutoCapture

// Far selfie capture mode
settings?.objFarSelfieSettings.captureMode = .AutoCapture

Semi-Auto Capture

This mode is similar to Auto, but only for the duration specified by the setting resetTimeOutInSec.

let settings = CFASelfieSettings()

// Near selfie capture mode
settings?.captureMode = .Semi_Auto

// Far selfie capture mode
settings?.objFarSelfieSettings.captureMode = .Semi_Auto

// Timeout near selfie capture after ten seconds
settings?.resetTimeOutInSec = 10

// Timeout far selfie capture after ten seconds
settings?.objFarSelfieSettings.resetTimeOutInSec = 10

Once the timeout is reached, then the behavior is determined by the following

Semi-Auto Timeout Behavior:
  • If exitAfterTimeout is enabled, then the SDK dismisses and sends a specific error to the delegate

  • If exitAfterTimeout is disabled and enableManualOverlay is enabled, then the user is presented with a dialog to either switch to manual capture or try again with auto capture

  • If exitAfterTimeout and enableManualOverlay are both disabled, then the SDK automatically switches to manual capture