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 frame 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 frame.

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 following are conditions that will invalidate the image for processing by the SDK:

  • Device Orientation - The device orientation is unsupported for the session.
  • Undetected Face/Finger - The SDK cannot detect the user's face or finger.
  • Tilted Head - The user's face is not facing directly towards the camera.
  • Face Too Far - The user's face is positioned too far from the camera. Instruct the user to hold the camera closer to their face.
  • Uneven Light - The light on the user's face is not evenly distributed.

Image validity verification is reported as part of onImage as part of ImageListener:

Kotlin
override fun onImage(imageData: ImageData) {
    runOnUiThread {
        when (imageData.imageValidity) {
            ImageValidity.VALID -> {
                // Valid
            }
            ImageValidity.INVALID_DEVICE_ORIENTATION -> {
                // Invalid device orientation
            }
            ImageValidity.INVALID_ROI -> {
                // Invalid ROI
            }
            ImageValidity.TILTED_HEAD -> {
                // Tilted Head
            }
            ImageValidity.FACE_TOO_FAR -> {
                // Face Too Far
            }
            ImageValidity.UNEVEN_LIGHT -> {
                // Uneven Light
            }
        }
    }
}
Java
@Override
public void onImage(@NonNull ImageData imageData) {
    runOnUiThread(() -> {
        switch (imageData.getImageValidity()) {
            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;
        }
    });
}