cropPortrait method

Image cropPortrait(
  1. Portrait portrait
)

Creates a portrait image by cropping the source image around the detected face.

param portrait The portrait to extract the face from. return The output cropped image of the face. throws FaceException An error has occurred during Face Library execution.

Implementation

Image cropPortrait(Portrait portrait) {
  Image image = Image();
  var err = faceSDK.id3FacePortraitProcessor_CropPortrait(_pHandle.value, portrait.handle, image.handle);
  if (err != FaceError.success.value) {
    image.dispose();
    throw FaceException(err);
  }
  return image;
}