Skip to content
On this page

Measurement Guidance

For precise face measurements with the Binah.ai SDK, the user is required to follow the image validation guidance. The SDK guides users to adhere to measurement guidelines, specifying exceptions in the Image Validity information. For detailed information on image validity, see the Image Validity page.

The SDK notifies the application about the image validity of each frame. It is highly recommended to prompt the user for any reported exception and instruct them to adhere to Binah.ai's best practices for taking a measurement. Utilize the sample application code for implementing image validity prompt notifications.

The SDK supports configuring whether to enable strict measurement guidance. This setting determines whether the SDK processes all video images when a face is detected (default behavior) or only processes images with valid image validity. In the following example, the strict measurement guidance is set to true:

Swift
do {
    let licenseDetails = LicenseDetails(licenseKey: "<ENTER_YOUR_LICENSE_KEY>")
    let session = try FaceSessionBuilder() 
        .withStrictMeasurementGuidance(true) 
        .withImageListener(self)
        .withVitalSignsListener(self)
        .withSessionInfoListener(self)
        .build(licenseDetails: licenseDetails)
}
catch {
    let e = error as NSError
    print("Received Error. Domain: \(e.domain) Code: \(e.code)")
}
Objective-c
BNHLicenseDetails *licenseDetails = [[BNHLicenseDetails alloc] initWithLicenseKey:@"<ENTER_YOUR_LICENSE_KEY>"];
BNHFaceSessionBuilder *sessionBuilder = [[[[[[BNHFaceSessionBuilder alloc] init] 
                                            withStrictMeasurementGuidance:true] 
                                           withImageListener:self]
                                          withVitalSignsListener:self]
                                         withSessionInfoListener:self];

NSError *error = nil;
id<BNHSession> _Nullable session = [sessionBuilder buildWithLicenseDetails:licenseDetails
                                                                     error:&error];
if (error != nil) {
    NSLog(@"Received Error. Domain: %@ Code: %ld", error.domain, (long)error.code);
}

Strict Measurement Guidance Set to False (Default)

When set to false (default SDK behavior), the SDK processes all video images as long as a face is detected (ROI image data exists).

Strict Measurement Guidance Set to True

When set to true, the SDK will process only valid face images.

If a sequence of invalid images persists for over 0.5 seconds, the SDK warns of a significant gap. In addition to affecting the precision of the results, these gaps may also cause delays in the appearance of vital signs and impact confidence in the final results.

On a third occurrence of a 0.5-second gap, the SDK throws an error, stopping the session without final results. This behavior statistically improves measurement precision and encourages users to follow measurement guidance more effectively.

The table below summarizes the differences between setting Strict Measurement Guidance to true and false.

Strict Measurement GuidanceFalse (default)True
Report Image Validity InfoYesYes
Images with invalid Image ValidityProcessed by SDK, as long as the face is detected (ROI image data exists)Not processed by SDK
Periods over 0.5 sec with invalid Image Validity but with ROI image dataNo warning is issuedIssues a warning when the user complies again with the guidelines
Impact on precisionNormal precisionIncreased precision