applyAlphaMask method
Applies an alpha mask to suppress the background and returns a 32-bit BGRA image.
param image Source image to process. param mask Mask of segmented face. return The output image. throws FaceException An error has occurred during Face Library execution.
Implementation
Image applyAlphaMask(Image image, Image mask) {
Image segmentedFace = Image();
var err = faceSDK.id3FaceAnalyser_ApplyAlphaMask(_pHandle.value, image.handle, mask.handle, segmentedFace.handle);
if (err != FaceError.success.value) {
segmentedFace.dispose();
throw FaceException(err);
}
return segmentedFace;
}