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
MBCaptureConstraints.V1Landmark validationNoCompatibility with existing V1 integrations.
MBCaptureConstraints.V2Distance, position, and poseNoGeometry-only capture.
MBCaptureConstraints.V3Distance, position, and poseYesRecommended for new integrations.

Selecting V3 does not change the result format. It changes which frames are accepted.

Enable V3​

Set the same options for the predefined UI and the custom UI:

// Predefined UI
launch({
captureConstrains: MBCaptureConstraints.V3,
imageQualityLevel: MBImageQualityLevel.LEVEL_2,
cameraPermissionAlert,
});

// Custom UI
const options = setCaptureSessionOptions({
captureConstrains: MBCaptureConstraints.V3,
imageQualityLevel: MBImageQualityLevel.LEVEL_2,
});

Choose a quality level​

LevelStrictnessSuggested starting point
MBImageQualityLevel.LEVEL_1Most permissiveDifficult or highly variable lighting environments.
MBImageQualityLevel.LEVEL_2BalancedGeneral production testing.
MBImageQualityLevel.LEVEL_3Strictest 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​

In the custom UI, V2 and V3 report every validation result through onFaceBoundingBoxValidating:

onFaceBoundingBoxValidating={(
facePoses: FacePose[] | null,
faceDistance: FaceDistance | null,
facePositions: FacePosition[] | null,
imageQualityStatus: MBImageQualityStatus | null,
isValid: boolean
) => {
// Show one instruction at a time: position, distance, pose, then lighting.
}}
ArgumentValues
facePosesFacePose.yaw, FacePose.pitch, FacePose.roll. null or empty when the pose is valid.
faceDistanceFaceDistance.too_close, FaceDistance.too_far_away. null when the distance is valid.
facePositionsFacePosition.too_far_up, too_far_down, too_far_left, too_far_right, not_found. null or empty when the position is valid.
imageQualityStatusV3 lighting status, see below. null with V2.
isValidtrue only when every active check passes.

Handlers written for earlier versions that accept only the first three arguments continue to work.

V1 reports a single status through the deprecated onFaceValidating(faceStatus: FaceStatus) prop.

Lighting statuses​

StatusUser action
MBImageQualityStatus.CHECKINGWait while the SDK obtains a fresh lighting measurement.
MBImageQualityStatus.VALIDNo lighting correction is required.
MBImageQualityStatus.INSUFFICIENT_LIGHTMove to a brighter area or add frontal light.
MBImageQualityStatus.UNEVEN_LIGHTINGUse 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.