public class TrackedFace
extends java.lang.Object
implements java.lang.AutoCloseable, java.io.Serializable
| Constructor and Description |
|---|
TrackedFace()
Creates a new instance of the TrackedFace class.
|
TrackedFace(long handle)
Creates a new instance of the TrackedFace class.
|
| Modifier and Type | Method and Description |
|---|---|
TrackedFace |
clone()
Creates a copy of the TrackedFace object.
|
void |
close()
Releases all resources used by this TrackedFace.
|
static TrackedFace |
create(Rectangle bounds,
int detectionScore,
int id,
PointList landmarks)
Creates a detected face.
|
protected void |
finalize()
Finalizer for this class.
|
static TrackedFace |
fromBuffer(byte[] data)
Imports the face object from a buffer.
|
static TrackedFace |
fromFile(java.lang.String path)
Imports the face object from a file.
|
DetectedFace |
getAsDetectedFace()
Gets the tracked face as a detected face.
|
Rectangle |
getBounds()
Gets the bounds of the detected face.
|
int |
getDetectionScore()
Gets the confidence score of the detected face.
|
int |
getDistanceToCamera(Image depthImage)
Gets the distance between the detected face and the camera when using a depth map in pixels.
|
Rectangle |
getExpandedBounds(float aspectRatio,
float margin)
Gets the bounding box around the detected face with specified aspect ratio and specified margin.
|
FaceTemplate |
getFaceTemplate()
Gets the computed template the tracked face.
|
long |
getHandle()
Gets the native handle.
|
int |
getId()
Gets the ID of the detected face.
|
int |
getInterocularDistance()
Gets the distance between the eyes (IOD) of the detected face in pixels.
|
PointList |
getLandmarks()
Gets the landmarks (eyes, nose and mouth corners) of the detected face.
|
Rectangle |
getPortraitBounds(float eyeImageWidthRatio,
float eyeImageHeightRatio,
float imageRatio)
Gets the bounding box of the detected face for ICAO portrait cropping.
|
Rectangle |
getPredictedBounds()
Gets the predicted bounds of the tracked face.
|
TrackingStatus |
getTrackingStatus()
Gets the status of the tracked face.
|
void |
rescale(float scale)
Rescales the detected face object bounding box and landmarks.
|
void |
rotate(int angle,
Point center)
Rotates the face object by a given angle in degrees from a given center.
|
void |
setBounds(Rectangle bounds)
Sets the bounds of the detected face.
|
void |
setId(int id)
Sets the ID of the detected face.
|
void |
setLandmarks(PointList landmarks)
Sets the landmarks (eyes, nose and mouth corners) of the detected face.
|
byte[] |
toBuffer()
Exports the face object to a buffer.
|
void |
toFile(java.lang.String path)
Saves the face object to a file.
|
void |
translate(int tx,
int ty)
Translates the face object.
|
public TrackedFace()
throws FaceException
FaceException - An error has occurred during Face Library execution.public TrackedFace(long handle)
throws FaceException
handle - Handle to the TrackedFace.FaceException - An error has occurred during Face Library execution.public void close()
close in interface java.lang.AutoCloseableprotected void finalize()
finalize in class java.lang.Objectpublic long getHandle()
public TrackedFace clone() throws FaceException
clone in class java.lang.ObjectFaceException - An error has occurred during Face Library execution.public Rectangle getBounds() throws FaceException
FaceException - An error has occurred during Face Library execution.public void setBounds(Rectangle bounds) throws FaceException
bounds - Bounds of the detected face.FaceException - An error has occurred during Face Library execution.public int getDetectionScore()
throws FaceException
FaceException - An error has occurred during Face Library execution.public FaceTemplate getFaceTemplate() throws FaceException
FaceException - An error has occurred during Face Library execution.public int getId()
throws FaceException
FaceException - An error has occurred during Face Library execution.public void setId(int id)
throws FaceException
id - ID of the detected face.FaceException - An error has occurred during Face Library execution.public PointList getLandmarks() throws FaceException
FaceException - An error has occurred during Face Library execution.public void setLandmarks(PointList landmarks) throws FaceException
landmarks - Landmarks (eyes, nose and mouth corners) of the detected face.FaceException - An error has occurred during Face Library execution.public Rectangle getPredictedBounds() throws FaceException
FaceException - An error has occurred during Face Library execution.public TrackingStatus getTrackingStatus() throws FaceException
FaceException - An error has occurred during Face Library execution.public static TrackedFace create(Rectangle bounds, int detectionScore, int id, PointList landmarks) throws FaceException
bounds - Bounds of the detected face.detectionScore - Confidence score of the detected face.id - ID of the detected face.landmarks - Landmarks (eyes, nose and mouth corners) of the detected face.FaceException - An error has occurred during Face Library execution.public static TrackedFace fromBuffer(byte[] data) throws FaceException
data - Buffer to import the face object from.FaceException - An error has occurred during Face Library execution.public static TrackedFace fromFile(java.lang.String path) throws FaceException
path - Path to the file to import the face object from.FaceException - An error has occurred during Face Library execution.public DetectedFace getAsDetectedFace() throws FaceException
FaceException - An error has occurred during Face Library execution.public int getDistanceToCamera(Image depthImage) throws FaceException
depthImage - Depth image to process.FaceException - An error has occurred during Face Library execution.public Rectangle getExpandedBounds(float aspectRatio, float margin) throws FaceException
aspectRatio - Aspect ratio of the bounding box. Default recommended value is 1.33 (4/3).margin - Relative margin around the detected face. Recommended value is 0.5.FaceException - An error has occurred during Face Library execution.public int getInterocularDistance()
throws FaceException
FaceException - An error has occurred during Face Library execution.public Rectangle getPortraitBounds(float eyeImageWidthRatio, float eyeImageHeightRatio, float imageRatio) throws FaceException
eyeImageWidthRatio - Ratio between eye distance and image width. Must be in the range ]0;1[. Default recommended value is 0.25.eyeImageHeightRatio - Ratio between eye distance to top and image height. Must be in the range ]0;1[. Default recommended value is 0.45.imageRatio - Ratio between image height and image width. Default recommended value is 1.33 (4/3).FaceException - An error has occurred during Face Library execution.public void rescale(float scale)
throws FaceException
scale - The multiplicative rescaling factor to apply to the face object.FaceException - An error has occurred during Face Library execution.public void rotate(int angle,
Point center)
throws FaceException
angle - Angle of the rotation to apply to the face object.center - Center of the rotation to apply to the face object.FaceException - An error has occurred during Face Library execution.public byte[] toBuffer()
throws FaceException
FaceException - An error has occurred during Face Library execution.public void toFile(java.lang.String path)
throws FaceException
path - Path to the file to export the face object to.FaceException - An error has occurred during Face Library execution.public void translate(int tx,
int ty)
throws FaceException
tx - Translation to apply to the face object alongside the x-axis.ty - Translation to apply to the face object alongside the y-axis.FaceException - An error has occurred during Face Library execution.Copyright © id3 Technologies. All rights reserved. eu.id3.face