DetectedFace Class

Namespace: id3.Face

Definition

Represents a detected face.
class DetectedFace
class DetectedFace implements Finalizable
public partial class DetectedFace
public class DetectedFace implements AutoCloseable, Serializable
public class DetectedFace
typedef struct id3DetectedFace *ID3_DETECTED_FACE;

Usage

detectedFaceInstance = DetectedFace()
# ...

Explicit destruction

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

Explicit destruction

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

Explicit destruction

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

Explicit destruction

DetectedFace detectedFaceInstance = new DetectedFace();
// ...
detectedFaceInstance.close();
private var detectedFaceInstance: DetectedFace? = nil
detectedFaceInstance = try DetectedFace()
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.