Skip to main content

Capture constraints and image quality

V3 adds a lighting-quality gate to the V2 face geometry checks. Capture starts only after the face passes distance, position, pose, and lighting validation.

Compare constraint versions​

VersionFace geometryLighting qualityUse case
.v1Landmark validationNoCompatibility with existing V1 integrations.
.v2Distance, position, and poseNoGeometry-only capture.
.v3Distance, position, and poseYesRecommended for new native integrations.

Selecting V3 does not change the captured media format. It changes which frames are accepted and records v3 in the result metadata.

Enable V3​

let options = MBCaptureSessionOptions(
captureConstraints: .v3,
imageQualityLevel: .level2
)

Choose a quality level​

LevelStrictnessSuggested starting point
.level1Most permissiveDifficult or highly variable lighting environments.
.level2BalancedGeneral production testing.
.level3Strictest and defaultControlled capture environments.

imageQualityLevel has no effect when .v1 or .v2 is selected.

V3 evaluates four lighting characteristics:

  • overall brightness
  • luminance variance
  • underexposure
  • illumination uniformity across the face

A frame fails the lighting gate when at least two measures are below the selected level.

Read validation status​

For V2 and V3, implement MBBoundingBoxFaceValidatorDelegate:

func onValidating(
_ faceStatus: Result<MBFaceGeometryModel, MBFaceBoundingBoxStatus>
) {
switch faceStatus {
case .success(let geometry):
// Geometry and the active V3 lighting gate are valid.

case .failure(let status):
if let distance = status.distanceError {
handle(distance)
} else if let position = status.positionalError?.first {
handle(position)
} else if let pose = status.poseError?.first {
handle(pose)
} else if let lighting = status.imageQualityStatus {
handle(lighting)
}
}
}

MBFaceBoundingBoxStatus.isValidStatus is true only when every active check passes.

Lighting statuses​

StatusUser action
.checkingWait while the SDK obtains a fresh lighting measurement.
.validNo lighting correction is required.
.insufficientLightMove to a brighter area or add frontal light.
.unevenLightingUse more even light on both sides of the face.

For the predefined UI, enable showFaceStatusLabel to let the SDK display this guidance. For a custom UI, convert these statuses into your own visible messages.