createPortrait method
- Image image
Analyses an image and creates a portrait with the first detected face or the currently tracked face if the update parameter is activated. This method performs the following tasks:
- Face detection
- Landmark detection (68 points)
- Head pose estimation
- Verification of subject position
- Geometric attributes computation
- Unified quality score computation
Important: This method requires the
FaceDetector,FaceLandmarksEstimatorandFacePoseEstimatormodels to be loaded.
param image Source image. return The newly created portrait. throws FaceException An error has occurred during Face Library execution.
Implementation
Portrait createPortrait(Image image) {
Portrait portrait = Portrait();
var err = faceSDK.id3FacePortraitProcessor_CreatePortrait(_pHandle.value, image.handle, portrait.handle);
if (err != FaceError.success.value) {
portrait.dispose();
throw FaceException(err);
}
return portrait;
}