vFace Export
This page covers vFace Biometric Export functionality. Using the Enrolment flow, a fixed sized, aligned image of the users face can be extracted from the output template for external use.
Template Format
The template format consists of a ZIP file container, inside which are a manifest encoded with Google Protocol Buffers (Protobuf) and additional data files, as follows
├── zip template root
├── capture_[tag]
│ ├── [tag]_aligned_face.png
│ ├── [tag]_aligned_face.png
│ ├── [tag]_aligned_face.png
├── manifest.veridiumhdr
, where [tag]
is a random 8 character identifier, [a-z 0-9].
Typical size is between 80 KB and 100 KB.
Extract the zipped template file to directly access aligned face images. Multiple aligned images maybe present which are used in the enrolment process to increase matching robustness. You may use any of these for external use.
Image Format
Aligned face images are frontal captures with eyes, nose, and mouth optimised to align to predefined co-ordinates (without introducing image distortions, for example, stretching).
Parameter | |
---|---|
Encoding | Lossless, Portable Network Graphics (PNG) |
Resolution | width:118, height:118 |
Size | 25 KB to 30 KB |
Right Eye co-ordinate | x:41 y:55 |
Left Eye co-ordinate | x:77 y:55 |
Nose Tip co-ordinate | x:59 y:75 |
Right Mouth Corner co-ordinate | x:44 y:95 |
Left Mouth Corner co-ordinate | x:74 y:95 |
[Note: right and left refer to the anatomical label]
Integration
Android Export
To enable output of Export data, override the doExport()
method in your app's VFace activity, which extends the VFaceBiometricActivity
base class, returning a boolean. For example, create a public static boolean
variable which can be set externally and returned by doExport()
:
public class MyVFaceActivity extends VFaceBiometricsActivity
{
...
public static boolean do_export = true;
@Override protected boolean doExport() {
return do_export;
}
}
Invoke the Enrol
operation, as described in Invoking an Operation, and the returned template will contain aligned face images for further processing by your app. Access the returned template as described in Handling An Operational Result. The template is a valid VFace enrol template that can also be used for authentication with the authenticate
operation.
By default, the Enrol
operation will result in an enrol template being stored locally for future authentication. This is a valid use case, and allows for simultaneous enrolment and export. However, you may disable local storage by overriding storeEnrollment()
:
public class MyVFaceActivity extends VFaceBiometricsActivity
{
...
@Override protected void storeEnrollment(BiometricsResult<?> biometricEnrolResult) {
return; // do nothing
}
}
iOS Export
To enable output of Export data, fetch the VFace enroler and set the value of doExport()
, for example,
let vface_enroller = VeridiumSDK.shared.enrollerVFace!
vface_enroller.config.doExport = true;
Call the enrol method, with handling blocks, as described in Enrolment:
vface_enroller.enroll({ (enrollmentVector) in
VeridiumUtils.alert("Enrollment Success", title:"Success");
enrollmentVector.biometricData // template data
}, onFail: {
VeridiumUtils.alert("Enrollment failed", title:"Failed");
}, onCancel: {
VeridiumUtils.alert("Enrollment failed", title:"Cancelled");
}, onError: {
(error) in
VeridiumUtils.alert(error.localizedDescription, title: "Error");
});
, where enrollmentVector.biometricData
is the template data (NSData) and will contain aligned face images. The template is a valid VFace enrol template that can also be used for authentication with the Authenticate operation.