Getting the best shot with an occluded face#
In LUNA ID, you can define whether images with occluded faces can be considered as best shots. This feature allows you to customize the behavior based on your specific requirements.
In LUNA ID for Android#
To determine whether an image with an occluded face will be considered the best shot, use the LunaConfig.acceptOccludedFaces
parameter.
The acceptOccludedFaces
parameter has the following values:
Value | Description |
---|---|
true |
Default. An image with an occluded face can be considered the best shot. |
false |
An image with an occluded face cannot be considered the best shot. The NotificationDetectionError event will appear in LunaID.allEvents() with payload DetectionError.OccludedFace every time an occluded face is recognized. |
Important: The
acceptOccludedFaces
parameter requires the lunaid-mask-X.X.X.aar dependency. For details, see Distribution kit.
To define that images with occluded faces can be considered as best shots:
1․ Add the required .plan files to your project dependencies:
implementation("ai.visionlabs.lunaid:mask:X.X.X@aar")
2․ Specify the acceptOccludedFaces
parameter in LunaConfig
:
LunaConfig.create(
acceptOccludedFaces = true
)
In LUNA ID for iOS#
To determine whether an image with an occluded face will be considered the best shot, use the LCLunaConfiguration.occludeCheck
parameter.
The occludeCheck
parameter has the following values:
Value | Description |
---|---|
true |
Default. An image with an occluded face can be considered the best shot. |
false |
An image with an occluded face cannot be considered the best shot. If an occluded face is recognized, either of the following errors will be returned: 1008, 1009, 1010. For error descriptions, see Status codes and errors. |