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:

Value Description
true Frames that contain faces with closed eyes can be best shots.
false Frames that contain faces with closed eyes cannot be best shots.

The default value is false.

Important: 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.

Example:

LunaConfig.create(
    acceptEyesClosed = false
)

For details on getting the best shot with two closed eyes, see Getting the best shot with faces with closed eyes.

acceptOccludedFaces#

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

Value Description
true An image with an occluded face can be the best shot.
false 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 default value is true.

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

Example:

LunaConfig.create(
    acceptOccludedFaces = true
)

For details on getting the best shot with an occluded face, see Getting the best shot with an occluded face.

acceptOneEyeClose#

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

Value Description
true 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 default value is true.

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

Example:

LunaConfig.create(
    acceptOneEyeClose = true
)

acceptOneEyed#

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

Value Description
true Enables blinking with one eye.
false Disables blinking with one eye.

The default value is false.

Important: 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.

Example:

LunaConfig.create(
    acceptOneEyed = false
)

ags#

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

The default value is 0.2.

Example:

LunaConfig.create(
    ags = 0.2f
)

bestShotInterval#

Specifies a minimum time interval between best shots.

The default value is 500.

Example:

LunaConfig.create(
    bestShotInterval = 500
)

bestShotsCount#

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

The default value is 1.

Example:

LunaConfig.create(
    bestShotsCount = 1
)

detectFrameSize#

Specifies a face detection bounding box size, in dp.

The default value is 350.

Example:

LunaConfig.create(
    detectFrameSize = 350
)

detectorStep#

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

The default value is 1.

Example:

LunaConfig.create(
    detectorStep = 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.

Example:

LunaConfig.create(
    faceSimilarityThreshold = 0.5f
)

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.

Example:

LunaConfig.create(
    foundFaceDelayMs = 0
)

glassesChecks#

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

Example:

LunaConfig.create(
    glassesChecks = setOf(GlassesCheckType.GLASSES_CHECK_SUN)
)

headPitch#

Specifies the head rotation angle along the X axis.

The default value is 25.

Example:

LunaConfig.create(
    headPitch = 25.0f
)

headRoll#

Specifies the head rotation angle along the Y axis.

Example:

LunaConfig.create(
    headRoll = 25.0f
)

headYaw#

Specifies the head rotation angle along the Z axis.

Example:

LunaConfig.create(
    headYaw = 25.0f
)

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.

Example:

LunaConfig.create(
    interactionDelayMs = 0
)

livenessCompressionQuality#

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

The default value is 50.

Example:

LunaConfig.create(
    livenessCompressionQuality = 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.

Example:

LunaConfig.create(
    livenessQuality = 0.5f
)

livenessType#

Specifies a OneShotLiveness estimation type. Possible values:

Value Description
LivenessType.Online Enables the Online OneShotLiveness estimation.
LivenessType.Offline Enables the Offline OneShotLiveness estimation.

Example:

LunaConfig.create(
    livenessType = LivenessType.Online
)

The default value is not set.

minimalTrackLength#

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

The default value is 1.

Example:

LunaConfig.create(
    minimalTrackLength = 1
)

onlineLivenessErrorTimeout#

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

The default value is not set.

Example:

LunaConfig.create(
    onlineLivenessErrorTimeout = Int
)

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.

Example:

LunaConfig.create(
    skipFrames = 36
)

usePrimaryFaceTracking#

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

Value Description
true Enables primary face tracking.
false Disables primary face tracking.

The default value is true.

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

Example:

LunaConfig.create(
    usePrimaryFaceTracking = true
)

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.

Example:

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.

The default value is 10.

Example:

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.

Example:

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.

Example:

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.

Example:

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.

Example:

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.

Example:

LCLunaConfiguration → bestShotConfiguration → numberOfBestShots = 3;

bestShotInterval#

Specifies a minimum time interval between best shots.

The default value is 0.5.

Example:

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.

Example:

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.

Example:

LCLunaConfiguration → bestShotConfiguration → livenessQuality = 0;

checkEyes#

Enables the eye state estimation.

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

Example:

LCLunaConfiguration → bestShotConfiguration → checkEyes = true;