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

# DetectedFace Class

Namespace: id3.Face

## Definition

Represents a detected face.
Python

    class DetectedFace

Dart

    class DetectedFace implements Finalizable

C#

    public partial class DetectedFace

Java

    public class DetectedFace implements AutoCloseable, Serializable

Swift

    public class DetectedFace

C

    typedef struct id3DetectedFace *ID3_DETECTED_FACE;

## Usage

Python

    detectedFaceInstance = id3face.DetectedFace()

Explicit destruction

    # ...
    del detectedFaceInstance

Dart

    final detectedFaceInstance = sdk.DetectedFace();
    // ...

Explicit destruction

    // ...
    detectedFaceInstance.dispose()

C#

    using (var detectedFaceInstance = new DetectedFace())
    {
       // ...
    }

Explicit destruction

    var detectedFaceInstance = new DetectedFace()
    // ...
    detectedFaceInstance.Dispose()

Java

    try (DetectedFace detectedFaceInstance = new DetectedFace()) {
    // ...
    }

Explicit destruction

    DetectedFace detectedFaceInstance = new DetectedFace();
    // ...
    detectedFaceInstance.close();

Swift

    private var detectedFaceInstance: DetectedFace? = nil
    detectedFaceInstance = try DetectedFace()

C

    ID3_DETECTED_FACE hDetectedFace{};
    int err = id3DetectedFace_Initialize(&hDetectedFace);
    if (err == ID3_SUCCESS) {
        // ...
        id3DetectedFace_Dispose(&hDetectedFace);
    }

## Properties

Name | Type | Description
--- | --- | ---
bounds | Rectangle | Bounds of the detected face.
detectionScore | int | Confidence score of the detected face.
id | int | ID of the detected face.
landmarks | PointList | Landmarks (eyes, nose and mouth corners) of the detected face.

## Static Methods

Name | Description
--- | ---
create | Creates a detected face.
fromBuffer | Imports the face object from a buffer.
fromFile | Imports the face object from a file.

## Methods

Name | Description
--- | ---
clone | Clones the DetectedFace object.
getDistanceToCamera | Gets the distance between the detected face and the camera when using a depth map in pixels.
getExpandedBounds | Gets the bounding box around the detected face with specified aspect ratio and specified margin.
getInterocularDistance | Gets the distance between the eyes (IOD) of the detected face in pixels.
getPortraitBounds | Gets the bounding box of the detected face for ICAO portrait cropping.
rescale | Rescales the detected face object bounding box and landmarks. This function can be useful if the image was downscaled to speed up detection, then you need to upscale the detected face to fit the source image size.
rotate | Rotates the face object by a given angle in degrees from a given center.
toBuffer | Exports the face object to a buffer.
toFile | Saves the face object to a file.
translate | Translates the face object.