About best shot estimations#
This section explains how LUNA ID evaluates image quality to get the best shot from a video stream.
How it works#
LUNA ID analyzes each frame of a video stream captured by your device's camera, searching for a face. For accurate evaluation, each frame must contain only one face. Frames with faces that pass specific estimations are considered the best shots.
If an estimation fails, the corresponding error message is returned.
In LUNA ID for Android#
- The
LunaID.allEvents()
event (or the more specializedLunaID.finishStates()
) emits aResultSuccess
event containing the best shot found and an optional path to the recorded video. - You can adjust parameters for best shot estimations in LunaConfig.kt.
In LUNA ID for iOS#
- The
CameraUIDelegate.bestShot()
callback receives the best shot. - You can adjust parameters for best shot estimations in the
LCLunaConfiguration
structure.
Estimations#
LUNA ID performs several estimations to determine if an image qualifies as the best shot:
- Number of faces in the frame
The estimation ensures that the frame contains only one face. If multiple faces are detected, the system returns aTooManyFacesError
error message.
By default, no value is set for this estimation. - AGS estimation
The estimation calculates a score indicating the suitability of the source image for descriptor extraction and matching. The output is a normalized float score ranging from 0 to 1. A score closer to 1 indicates better matching results for the image. - Head pose estimation
The estimation determines a person's head rotation angles in 3D space, specifically along the pitch, yaw, and roll axes. - Image quality estimation
The estimation evaluates an image based on several key criteria to ensure it meets the necessary standards. These criteria include:- Blurriness
- Underexposure
- Overexposure
- Uneven illumination
- Specularity
- Face detection bounding box size
The estimation ensures that the detected face's bounding box matches a specified size. This estimation helps determine if the subject is too far from the camera, affecting image quality. - Frame edges offset
The estimation calculates the distance from the detected face's bounding box to the edges of the image. - Eye state
The estimation determines whether the eyes in a detected face are open or closed. - Medical mask estimation
The estimation determines whether the face in a frame is partially covered by a medical mask. This feature allows you to define whether such frames can still be considered as best shots. For details, see Getting the best shot with an occluded face. - Mouth estimation
The estimation determines whether the mouth in a frame is occluded by an object, such as a hand or other obstructions. - Glasses estimation
The estimation determines whether the eyes in a frame are occluded by glasses.