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 can use it to process and calculate vital sign results. Otherwise, the SDK reports the reason for invalidating the image.

If a sequence of invalid images lasts for more than 0.5 seconds or if the device fails to process images at the required frequency, the SDK notifies the application about the significant gap in image processing. This may cause a delay in the appearance of vital signs, affecting the confidence and expected accuracy of the results.

If a sequence of invalid images occurs for a third time during the measurement, lasting for more than 0.5 seconds, the SDK throws an error, and the session stops.

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

NameMeaning
VALIDThe image is valid.
INVALID_DEVICE_ORIENTATIONThe device orientation is unsupported for the session.
INVALID_ROIThe SDK cannot detect the user's face or finger.
TILTED_HEADThe user's face is not facing directly towards the camera.
FACE_TOO_FARThe user's face is positioned too far from the camera. Instruct the user to hold the camera closer to their face.
UNEVEN_LIGHTThe light on the user's face is not evenly distributed.

Image validity verification is reported as part of ImageData object:

TypeScript
import { 
    useImages,
    ImageData,
    ImageValidity
} from 'binah-react-native-sdk';

const imageData = useImages();

React.useEffect(() => {
    switch (imageData.imageValidity) {
        case ImageValidity.VALID:
            // Valid
            break;
        case ImageValidity.INVALID_DEVICE_ORIENTATION:
            // Invalid device orientation
            break;
        case ImageValidity.INVALID_ROI:
            // Invalid ROI
            break;
        case ImageValidity.TILTED_HEAD:
            // Tilted Head
            break;
        case ImageValidity.FACE_TOO_FAR:
            // Face Too Far
            break;
        case ImageValidity.UNEVEN_LIGHT:
            // Uneven Light
            break;
    }
}, [imageData]);

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.