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

# TrackedFace Class

Namespace: id3.Face

## Definition

Represents a tracked face.
Python

    class TrackedFace

Dart

    class TrackedFace implements Finalizable

C#

    public partial class TrackedFace

Java

    public class TrackedFace implements AutoCloseable, Serializable

Swift

    public class TrackedFace

C

    typedef struct id3TrackedFace *ID3_TRACKED_FACE;

## Usage

Python

    trackedFaceInstance = id3face.TrackedFace()

Explicit destruction

    # ...
    del trackedFaceInstance

Dart

    final trackedFaceInstance = sdk.TrackedFace();
    // ...

Explicit destruction

    // ...
    trackedFaceInstance.dispose()

C#

    using (var trackedFaceInstance = new TrackedFace())
    {
       // ...
    }

Explicit destruction

    var trackedFaceInstance = new TrackedFace()
    // ...
    trackedFaceInstance.Dispose()

Java

    try (TrackedFace trackedFaceInstance = new TrackedFace()) {
    // ...
    }

Explicit destruction

    TrackedFace trackedFaceInstance = new TrackedFace();
    // ...
    trackedFaceInstance.close();

Swift

    private var trackedFaceInstance: TrackedFace? = nil
    trackedFaceInstance = try TrackedFace()

C

    ID3_TRACKED_FACE hTrackedFace{};
    int err = id3TrackedFace_Initialize(&hTrackedFace);
    if (err == ID3_SUCCESS) {
        // ...
        id3TrackedFace_Dispose(&hTrackedFace);
    }

## Properties

Name | Type | Description
--- | --- | ---
bounds | Rectangle | Bounds of the detected face.
detectionScore | int | Confidence score of the detected face.
faceTemplate | FaceTemplate | Computed template the tracked face. It aims at tracking an identity over time and is consolidated.
id | int | ID of the detected face.
landmarks | PointList | Landmarks (eyes, nose and mouth corners) of the detected face.
predictedBounds | Rectangle | Predicted bounds of the tracked face. Those bounds are computed using a Kalman filter which has the effect of making them smooth and robust to false non-detections.
trackingStatus | TrackingStatus | Status of the tracked face. See FaceTrackingStatus for more details.

## 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 TrackedFace object.
getAsDetectedFace | Gets the tracked face as a detected face.
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.