PortraitProcessor.removeBackground Method¶
Module: PortraitProcessor
Definition¶
Removes the background on the specified portrait image.
Important
This method requires the FaceBackgroundSegmenter1A model to be loaded.
remove_background(self, image: Image, red: int, green: int, blue: int) -> None
Parameters
imageImagein The portrait 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.
Exceptions
An error has occurred during Face Library execution.
void removeBackground(Image image, int red, int green, int blue)
Parameters
imageImagein The portrait 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.
Exceptions
An error has occurred during Face Library execution.
public void RemoveBackground(Image image, int red, int green, int blue)
Parameters
imageImagein The portrait 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.
Exceptions
An error has occurred during Face Library execution.
public void removeBackground(Image image, int red, int green, int blue) throws FaceException
Parameters
imageImagein The portrait 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.
Exceptions
An error has occurred during Face Library execution.
public func removeBackground(image: Image, red: Int32, green: Int32, blue: Int32) throws
Parameters
imageImagein The portrait 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.
Exceptions
An error has occurred during Face Library execution.
int id3FacePortraitProcessor_RemoveBackground (
ID3_FACE_PORTRAIT_PROCESSOR hPortraitProcessor,
ID3_FACE_IMAGE hImage,
int red,
int green,
int blue)
Parameters
hPortraitProcessorID3_FACE_PORTRAIT_PROCESSORin Handle to the PortraitProcessor object.hImageID3_FACE_IMAGEin The portrait 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