createTemplate method
- Image image,
- DetectedFace detectedFace
Extracts the unique features of a detected face and store them in a FaceTemplate.
Warning: A minimum interocular distance (IOD) of 30 pixels for the detected face is required for this function, below this value it will output an error.
Important: Loading a FaceEncoder model is required to use this function.
param image Source image to process. param detectedFace Detected face to process. return The generated face template. throws FaceException An error has occurred during Face Library execution.
Implementation
FaceTemplate createTemplate(Image image, DetectedFace detectedFace) {
FaceTemplate faceTemplate = FaceTemplate();
var err = faceSDK.id3FaceEncoder_CreateTemplate(_pHandle.value, image.handle, detectedFace.handle, faceTemplate.handle);
if (err != FaceError.success.value) {
faceTemplate.dispose();
throw FaceException(err);
}
return faceTemplate;
}