Appearance
Measurement Modes
The SDK supports three measurements modes - face measurements, finger measurements and Polar measurements.
Face Measurement
A face measurement is performed by facing the front (selfie) camera.
Swift
do {
let licenseDetails = LicenseDetails(licenseKey: "<ENTER_YOUR_LICENSE_KEY>")
let session = try FaceSessionBuilder()
.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]
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);
}
Finger Measurement
Deprecation Warning
Finger measurements are deprecated and will be removed in future versions of Binah.ai's SDK.
A finger measurement is performed by covering the rear camera of a device with a finger.
Swift
do {
let licenseDetails = LicenseDetails(licenseKey: "<ENTER_YOUR_LICENSE_KEY>")
let session = try FingerSessionBuilder()
.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>"];
BNHFingerSessionBuilder *sessionBuilder = [[[[[BNHFingerSessionBuilder alloc] init]
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);
}
Polar Measurement
A Polar measurement is conducted by connecting to the Polar Verity Sense sensor and wearing it snugly on clean skin on the non-dominant upper arm. Users should avoid placing it over tattoos, wounds, scars, etc. The sensor should have direct contact with the skin (under clothing, not above). Clean the skin area in contact with the sensor and also clean the sensor with a wipe. For additional information, refer to the Polar Verity Sense User Manual.
Swift
do {
let licenseDetails = LicenseDetails(licenseKey: "<ENTER_YOUR_LICENSE_KEY>")
let deviceID = "<ENTER_POLAR_DEVICE_ID>"
let session = try PolarSessionBuilder(polarDeviceID: deviceID)
.withSessionInfoListener(self)
.withVitalSignsListener(self)
.withPPGDeviceInfoListener(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>"];
NSString *deviceID = @"<ENTER_POLAR_DEVICE_ID>";
BNHSessionBuilder *sessionBuilder = [[[[[BNHPolarSessionBuilder alloc] initWithPolarDeviceID:deviceID]
withVitalSignsListener:self]
withSessionInfoListener:self]
withPPGDeviceInfoListener: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);
}
The Polar Device ID can either be retrieved by the PPG Device Scanner or found on the Polar device as shown in the image below: