Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# PortraitProcessor Class

Namespace: id3.Face

## Definition

Facilitates the creation of portraits in various scenarios such as enrolment or face verification.
Python

    class PortraitProcessor

Dart

    class PortraitProcessor implements Finalizable

C#

    public partial class PortraitProcessor

Java

    public class PortraitProcessor implements AutoCloseable, Serializable

Swift

    public class PortraitProcessor

C

    typedef struct id3FacePortraitProcessor *ID3_FACE_PORTRAIT_PROCESSOR;

## Usage

Python

    portraitProcessorInstance = id3face.PortraitProcessor()

Explicit destruction

    # ...
    del portraitProcessorInstance

Dart

    final portraitProcessorInstance = sdk.PortraitProcessor();
    // ...

Explicit destruction

    // ...
    portraitProcessorInstance.dispose()

C#

    using (var portraitProcessorInstance = new PortraitProcessor())
    {
       // ...
    }

Explicit destruction

    var portraitProcessorInstance = new PortraitProcessor()
    // ...
    portraitProcessorInstance.Dispose()

Java

    try (PortraitProcessor portraitProcessorInstance = new PortraitProcessor()) {
    // ...
    }

Explicit destruction

    PortraitProcessor portraitProcessorInstance = new PortraitProcessor();
    // ...
    portraitProcessorInstance.close();

Swift

    private var portraitProcessorInstance: PortraitProcessor? = nil
    portraitProcessorInstance = try PortraitProcessor()

C

    ID3_FACE_PORTRAIT_PROCESSOR hPortraitProcessor{};
    int err = id3FacePortraitProcessor_Initialize(&hPortraitProcessor);
    if (err == ID3_SUCCESS) {
        // ...
        id3FacePortraitProcessor_Dispose(&hPortraitProcessor);
    }

## Properties

Name | Type | Description
--- | --- | ---
backgroundColorUniformityThreshold | int | Background color uniformity threshold.
backgroundStructureUniformityThreshold | int | Background structure uniformity threshold.
cropAspectRatio | float | Aspect ratio (height to width) of the cropped portrait image.
cropEyePositionRatio | float | Ratio between the vertical eye position and the image height for ICAO portrait cropping. Must be in the range ]0;1[.
cropIodRatio | float | Ratio between the interocular distance (IOD) and the image width for ICAO portrait cropping. Must be in the range ]0;1[.
cropMargin | float | Relative margin around the face for basic portrait cropping.
dynamicRangeThreshold | int | Face dynamic range threshold.
equalBrightnessThreshold | int | Equal brightness threshold.
expressionSensibility | int | Sensibility of the expression classifier.
eyeOcclusionThreshold | int | Visible eye threshold.
eyeOpeningThreshold | int | Eye opening threshold.
faceDetectionImageSize | int | The size, in pixels, of the downscaled image used for face detection.
faceDetectionModel | FaceModel | Specifies the model used to detect and track faces.
faceDetectionThreshold | int | Specifies the face detection confidence threshold, in the range is [0;100].
faceEncodingModel | FaceModel | Model used to create features and assess consistancy among views of a given face.
faceMaskThreshold | int | Face mask detection threshold.
glassesThreshold | int | Glasses detection threshold.
hatThreshold | int | Threshold for confirming that the person is wearing a hat.
makeupThreshold | int | Make-up detection threshold.
maleThreshold | int | Male gender detection threshold.
maximumEyeGazeX | int | Maximum value of the eye gaze alongside the X axis.
maximumEyeGazeY | int | Maximum value of the eye gaze alongside the Y axis.
maximumHeadHeightRatio | int | Maximum distance between the base of the chin and the crown is less than 80% of the total height of the image.
maximumHeadWidthRatio | int | Value indicating if the image width is conform to the (image width / head width) ratio of 7:5.
maximumHorizontalPosition | int | Value indicating if the head is correctly centered horizontally.
maximumIod | int | Maximum interocular distance (IOD), in pixels.
maximumPitchAngle | float | Maximum head pitch angle, in degrees, for frontal positioning.
maximumRollAngle | float | Maximum head roll angle, in degrees, for frontal positioning.
maximumVerticalPosition | int | Maximum distance from the bottom edge of the image to the imaginary line passing through the center of the eyes is between 50% - 70% of the total vertical length of the image.
maximumYawAngle | float | Maximum head yaw angle, in degrees, for frontal positioning.
minimumHeadHeightRatio | int | Minimum distance between the base of the chin and the crown is less than 80% of the total height of the image.
minimumHeadWidthRatio | int | Value indicating if the image width is conform to the (image width / head width) ratio of 7:5.
minimumHorizontalPosition | int | Value indicating if the head is correctly centered horizontally.
minimumIod | int | Minimum intra-occular distance, in pixels.
minimumVerticalPosition | int | Minimum distance from the bottom edge of the image to the imaginary line passing through the center of the eyes is between 50% - 70% of the total vertical length of the image.
mouthOcclusionThreshold | int | Mouth occlusion threshold.
mouthOpenThreshold | int | Mouth opening threshold.
naturalSkinColorThreshold | int | Natural skin color threshold.
noFlashReflectionThreshold | int | Flash reflexion detection threshold.
noiseThreshold | int | Threshold for confirming the presence of noise in the image.
noseOcclusionThreshold | int | Nose occlusion threshold.
overExposureThreshold | int | Over exposure threshold.
padThreshold | int | Presentation attack detection threshold, from 0 to 100.
pixelationThreshold | int | Pixelation detection threshold.
redEyeThreshold | int | Threshold for confirming the presence of red eyes.
resolutionThreshold | int | Threshold indicating whether the image resolution is sufficient.
sharpnessThreshold | int | Sharpness threshold.
smileThreshold | int | Smile threshold.
threadCount | int | Number of threads to be used for portrait processing.
tintedGlassThreshold | int | Tinted glass detection threshold.
trackerMatchingThreshold | int | Minimum match score to reach to preserve the ID of a tracked face between frame ‘t-1’ and frame ‘t’.
trackerMaximumFaceAge | int | Maximum number of consecutive non-detections to be reached before deleting a tracked face.
trackerMinimumFaceAge | int | Minimum number of consecutive detections to reach before creating a tracked face.
trackerNmsIouThreshold | int | Non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range [0;100].
underExposureThreshold | int | Under exposure threshold.

## Methods

Name | Description
--- | ---
createPortrait | Analyses an image and creates a portrait with the first detected face or the currently tracked face if the update parameter is activated.
cropIcaoPortrait | Creates an ICAO-compliant portrait image by cropping the source image around the detected face.
cropPortrait | Creates a portrait image by cropping the source image around the detected face.
detectOcclusions | Detects occlusions on the subject’s face.
detectPresentationAttack | Detects a possible presentation attack.
estimateAge | Estimates the age of the person.
estimateBackgroundUniformity | Checks the background uniformity of the specified portrait.
estimateExpression | Estimates the subject’s expression on the specified portrait.
estimateFaceAttributes | Estimates the face attributes of the specified portrait.
estimateGeometryQuality | Estimates the geometric quality of the specified portrait according to the ICAO portrait parameters.
estimatePhotographicQuality | Etimates the photographic quality of the specified portrait.
removeBackground | Removes the background on the specified portrait image.
reset | Resets the face tracker.
updatePortrait | Analyses an image and updates the specified portrait with the first detected face or the currently tracked face.