Skip to content

Getting the best shot with faces with occluded eyes#

In LUNA ID, you can define whether an image in with occluded eyes can be considered the best shot.

In LUNA ID for Android, you can specify the following eye occlusion rules:

  • Images of people in sunglasses cannot be best shots.
  • Images of people in eyeglasses cannot be best shots.
  • Images of people in any glasses cannot be best shots.

In LUNA ID for iOS, images that contain faces with sunglasses will be excluded from best shot candidates. Images that contain faces with eyeglasses can be best shots.

In LUNA ID for Android#

To get best shots with faces with occluded eyes:

1․ Add the required .plan files to the dependency:

implementation("ai.visionlabs.lunaid:glasses:X.X.X@aar")

2․ Specify the glassesChecks parameter in LunaConfig to define the type of glasses in the image and whether the image can be the best shot:

lunaConfig = LunaConfig.create(
            glassesChecks = setOf(GlassesCheckType.GLASSES_CHECK_SUN, GlassesCheckType.GLASSES_CHECK_DIOPTER)
        ) 

glassesChecks#

Specifies what images with glasses can be best shots.

Possible values:

Value Description
GlassesCheckType.GLASSES_CHECK_SUN Defines that images with people in sunglasses cannot be best shots.
GlassesCheckType.GLASSES_CHECK_DIOPTER Defines that images with people in eyeglasses cannot be best shots.

You can specify either one, none, or both possible values.

The default value is not set.

In LUNA ID for iOS#

To get best shots with faces with occluded eyes, set the LCLunaConfiguration.glassesCheckEnabled property to true. The default value is false. This will enable the eye occlusion estimation. Only images that contain faces in eyeglasses will be considered best shots.

Optionally, you can set the LCLunaConfiguration.advancedSunglasses property to true to prohibit getting best shots with transparent sunglasses. The default value is false.