Skip to content

Best shot properties#

In LUNA ID for Android#

This section describes properties that apply to the LunaConfig class. You can use them to configure getting the best shot.

acceptEyesClosed

Specifies whether an image with two closed eyes will be considered the best shot. Possible values:

  • true - Default. Specifies that frames that contain faces with closed eyes can be best shots. For details on getting the best shot with two closed eyes, see Getting the best shot with faces with closed eyes.
  • false - Specifies that frames that contain faces with closed eyes cannot be best shots.

The acceptEyesClosed property requires the lunaid-common-x86-X.X.X.aar, lunaid-common-arm-X.X.X.aar dependencies. For details, see Distribution kit.

acceptOccludedFaces

Specifies whether an image with an occluded face will be considered the best shot. Possible values:

  • true - Default. Specifies that an image with an occluded face can be the best shot. For details on getting the best shot with an occluded face, see Getting the best shot with an occluded face.
  • false - Specifies that an image with an occluded face cannot be the best shot. The NotificationDetectionError event will appear in LunaID.allEvents() with payload DetectionError.OccludedFace every time an occluded face is recognized.

The acceptOccludedFaces property requires the lunaid-mask-X.X.X.aar dependency. For details, see Distribution kit.

acceptOneEyeClose

Specifies whether frames that contain faces with one closed eye can be best shots. Possible values:

  • true - Default. Specifies that frames that contain faces with a closed eye can be best shots.
  • false - Specifies that frames that contain faces with a closed eye cannot be best shots. However, it is possible to get the best shot with an occluded eye. For details, see Getting the best shot with faces with occluded eyes.

The acceptOneEyeClose property requires the acceptOneEyed property to be enabled. For details, see Performing Dynamic Liveness estimation.

acceptOneEyed

Enables or disables the Dynamic Liveness estimation interaction via blinking with one eye. Possible values:

  • true - Enables blinking with one eye.
  • false - Default. Disables blinking with one eye.

The acceptOneEyed property requires the lunaid-common-x86-X.X.X.aar, lunaid-common-arm-X.X.X.aar dependencies. For details, see Distribution kit.

ags

Specifies an AGS threshold for further descriptor extraction and matching. For details, see AGS estimation.

The default value is 0.2.

bestShotInterval

Specifies a minimum time interval between best shots.

The default value is 500.

bestShotsCount

Specifies a number of best shots that need to be collected for a OneShotLiveness estimation.

The default value is 1.

blurThreshold

Specifies a threshold that determines whether the image is blurred.

The default value is 0.61.

darknessThreshold

Specifies a threshold that determines whether the image is underexposed, that is, too dark.

The default value is 0.50.

detectFrameSize

Specifies a face detection bounding box size, in dp.

The default value is 350.

detectorStep

Specifies a number of frames between frames with full face detection.

The default value is 1.

faceSimilarityThreshold

Specifies a threshold that determines whether the face that was first detected in the face recognition area remains the same when tracking face identity.

The default value is 0.5.

foundFaceDelayMs

Specifies a delay, in milliseconds, to define for how long a user's face should be placed in the face detection bounding box before the best shot is taken.

The default value is 0.

glassesChecks

Specifies what images with glasses can be best shots. For details, see Getting the best shot with faces with occluded eyes.

headPitch

Specifies the head rotation angle along the X axis.

The default value is 25.

headRoll

Specifies the head rotation angle along the Y axis.

The default value is 25.

headYaw

Specifies the head rotation angle along the Z axis.

The default value is 25.

interactionDelayMs

Specifies a timeout between Dynamic Liveness estimation interactions, in milliseconds. This means that a new interaction will start after the preceding one ends after the timeout has passed.

The default value is 0.

lightThreshold

Specifies a threshold that determines whether the image is overexposed, that is, too light.

The default value is 0.57.

livenessCompressionQuality

Specifies a quality of the image to be sent to OneShotLiveness estimation. Value 0 represents the maximum compression.

The default value is 50.

livenessQuality

Specifies a OneShotLiveness estimation threshold lower which the system will consider the result as a presentation attack.

The default value is 0.5.

livenessType

Specifies a OneShotLiveness estimation type. Possible values:

The default value is not set.

minFaceSize

Specifies the minimum acceptable size, in pixels, for a detected face. Faces smaller than this size will be ignored during the detection process.

The parameter values range from 20 to 350.

  • When set to a higher value, it ensures that only larger, more prominent faces are processed, which can improve performance and reduce noise from distant or small faces.
  • When set to a lower value, it allows for the detection of smaller faces but may increase processing time and the likelihood of detecting irrelevant faces.

The default value is 50.

minimalTrackLength

Specifies the minimum number of detections to consider there is a real face in a video track.

The default value is 1.

onlineLivenessErrorTimeout

Specifies a timeout within which a OneShotLiveness estimation should be performed.

The default value is not set.

skipFrames

Specifies a number of frames to wait until a face is detected in the face recognition area before video recording is stopped.

The default value is 36.

strictlyMinSize

Specifies whether the minFaceSize parameter will be considered during face detection. Possible values:

  • true - The minFaceSize parameter is ignored, and all detected faces, regardless of size, are considered for further processing.
  • false - Default. LUNA ID strictly enforces the minFaceSize threshold, ensuring that only faces meeting or exceeding this size are detected and processed.
usePrimaryFaceTracking

Specifies whether to track the face that was detected in the face recognition area first. For details, see Tracking face identity. Possible values:

  • true - Default. Enables primary face tracking.
  • false - Disables primary face tracking.

The acceptOccludedFaces property requires the lunaid-cnn59-1X.X.X.aar dependency. For details, see Distribution kit.

In LUNA ID for iOS#

This section describes properties that apply to the LCBestShotConfiguration configuration instance. You can use them to configure getting the best shot.

estimationThreshold

Specifies a best shot estimation threshold.

The default value depends on a best shot estimation.

LCLunaConfiguration → bestShotConfiguration → estimationThreshold → ags = 0.2;
borderDistance

Specifies the distance, in pixels, from the frame edges and is based on the face detection bounding box size estimation. For details, see Frame edges offset estimation.

The default value is 10.

LCLunaConfiguration → bestShotConfiguration → borderDistance = 10;
minDetSize

Specifies a bounding box size, in pixels. For details, see Face detection bounding box size estimation.

The default value is 200.

LCLunaConfiguration → bestShotConfiguration → minDetSize = 200;
detectorStep

Specifies a number of frames to be taken between face detections. The smaller the number is, the more likely that TrackEngine will detect a new face as soon as it appears in the frame. The higher the number is, the higher the overall performance is. You can use the property to balance the performance and face detection frequency.

Accepted values vary from 0 to 30.

The default value is 7.

LCLunaConfiguration → bestShotConfiguration → detectorStep = 7;
skipFrames

Specifies a number of frames to wait until a face is detected in the face recognition area before video recording is stopped.

Accepted values vary from 0 to 50.

The default value is 36.

LCLunaConfiguration → bestShotConfiguration → skipFrames = 36;
minimalTrackLength

Specifies the minimum number of detections to consider there is a real face in a video track.

The default value is 5.

LCLunaConfiguration → bestShotConfiguration → minimalTrackLength = 5;
numberOfBestShots

Specifies a number of best shots that need to be collected for a OneShotLiveness estimation.

The default value is 3.

LCLunaConfiguration → bestShotConfiguration → numberOfBestShots = 3;
bestShotInterval

Specifies a minimum time interval between best shots.

The default value is 0.5.

LCLunaConfiguration → bestShotConfiguration → bestShotInterval = 0.5;
similarityThreshold

Specifies a threshold that determines whether the face that was first detected in the face recognition area remains the same when tracking face identity.

The default value is 0.01.

LCLunaConfiguration → bestShotConfiguration → similarityThreshold = 0.01;
livenessQuality

Specifies a OneShotLiveness estimation threshold lower which the system will consider the result as a presentation attack.

The default value is 0.

LCLunaConfiguration → bestShotConfiguration → livenessQuality = 0;
checkEyes

Enables the eye state estimation.

If set to true, the best shot with closed eyes will be skipped.

LCLunaConfiguration → bestShotConfiguration → checkEyes = true;