FaceAnalyser.applyMask Method¶
Module: FaceAnalyser
Definition¶
Applies a mask to replace the background with the specified color and returns a 24-bit BGR image.
apply_mask(self, image: Image, mask: Image, red: int, green: int, blue: int) -> Image
Parameters
imageImagein Source image to process.maskImagein Mask to be applied. Must be a 8-bit greyscale image of same size as the input image.redintin Green channel of the background color. Must be a value from 0 to 255.greenintin Red channel of the background color. Must be a value from 0 to 255.blueintin Blue channel of the background color. Must be a value from 0 to 255.
Returns
The output image.
Exceptions
An error has occurred during Face Library execution.
Image applyMask(Image image, Image mask, int red, int green, int blue)
Parameters
imageImagein Source image to process.maskImagein Mask to be applied. Must be a 8-bit greyscale image of same size as the input image.redintin Green channel of the background color. Must be a value from 0 to 255.greenintin Red channel of the background color. Must be a value from 0 to 255.blueintin Blue channel of the background color. Must be a value from 0 to 255.
Returns
The output image.
Exceptions
An error has occurred during Face Library execution.
public Image ApplyMask(Image image, Image mask, int red, int green, int blue)
Parameters
imageImagein Source image to process.maskImagein Mask to be applied. Must be a 8-bit greyscale image of same size as the input image.redintin Green channel of the background color. Must be a value from 0 to 255.greenintin Red channel of the background color. Must be a value from 0 to 255.blueintin Blue channel of the background color. Must be a value from 0 to 255.
Returns
The output image.
Exceptions
An error has occurred during Face Library execution.
public Image applyMask(Image image, Image mask, int red, int green, int blue) throws FaceException
Parameters
imageImagein Source image to process.maskImagein Mask to be applied. Must be a 8-bit greyscale image of same size as the input image.redintin Green channel of the background color. Must be a value from 0 to 255.greenintin Red channel of the background color. Must be a value from 0 to 255.blueintin Blue channel of the background color. Must be a value from 0 to 255.
Returns
The output image.
Exceptions
An error has occurred during Face Library execution.
public func applyMask(image: Image, mask: Image, red: Int32, green: Int32, blue: Int32) throws -> Image
Parameters
imageImagein Source image to process.maskImagein Mask to be applied. Must be a 8-bit greyscale image of same size as the input image.redInt32in Green channel of the background color. Must be a value from 0 to 255.greenInt32in Red channel of the background color. Must be a value from 0 to 255.blueInt32in Blue channel of the background color. Must be a value from 0 to 255.
Returns
The output image.
Exceptions
An error has occurred during Face Library execution.
int id3FaceAnalyser_ApplyMask (
ID3_FACE_ANALYSER hFaceAnalyser,
ID3_FACE_IMAGE hImage,
ID3_FACE_IMAGE hMask,
int red,
int green,
int blue,
ID3_FACE_IMAGE hSegmentedFace)
Parameters
hFaceAnalyserID3_FACE_ANALYSERin Handle to the FaceAnalyser object.hImageID3_FACE_IMAGEin Source image to process.hMaskID3_FACE_IMAGEin Mask to be applied. Must be a 8-bit greyscale image of same size as the input image.redintin Green channel of the background color. Must be a value from 0 to 255.greenintin Red channel of the background color. Must be a value from 0 to 255.blueintin Blue channel of the background color. Must be a value from 0 to 255.hSegmentedFaceID3_FACE_IMAGEout The output image.
Returns