Skip to content
On this page

Image Validity

While the basic instruction for taking a measurement is simple—just look at the camera and start the measurement—there are a few guidelines that the user must follow to ensure accurate measurement results. These guidelines are listed in Binah.ai's best practices for taking a measurement.

During the measurement, the SDK assists the user in following these guidelines. It validates each camera image and updates the imageValidity with any detected deviations from the guidelines.

An image is considered valid if the SDK did not detect any violations to the Binah.ai's best practices for taking a measurement. If the image is not considered valid the SDK reports the reason for invalidating the image.

The conditions in the table below will invalidate the image for processing by the SDK.

NameMeaning
validThe image is valid.
invalidDeviceOrientationThe device orientation is unsupported for the session.
invalidRoiThe SDK cannot detect the user's face or finger.
tiltedHeadThe user's face is not facing directly towards the camera.
faceTooFarThe user's face is positioned too far from the camera. Instruct the user to hold the camera closer to their face.
unevenLightThe light on the user's face is not evenly distributed.

Image validity verification is reported as part of onImageData as part of ImageDataListener:

Dart
@override
void onImageData(ImageData imageData) {
    switch (imageData.imageValidity) {
        case ImageValidity.valid:
            // Valid
            break;
        case ImageValidity.invalidDeviceOrientation:
            // Invalid device orientation
            break;
        case ImageValidity.invalidRoi:
            // Invalid ROI
            break;
        case ImageValidity.tiltedHead:
            // Tilted Head
            break;
        case ImageValidity.faceTooFar:
            // Face Too Far
            break;
        case ImageValidity.unevenLight:
            // Uneven Light
            break;
    }
}

Note

It is possible that an image is not valid due to several reasons. For example, when a user is too far and the light is not evenly distributed on his face.