eu.id3.face

## Class FaceTracker

- java.lang.Object
- - eu.id3.face.FaceTracker

- All Implemented Interfaces:
    java.io.Serializable, java.lang.AutoCloseable

      public class FaceTracker
      extends java.lang.Object
      implements java.lang.AutoCloseable, java.io.Serializable

  Tracks faces on consecutive images and automatically creates and updates associated face templates.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `FaceTracker()` Creates a new instance of the FaceTracker class.
    `FaceTracker(long handle)` Creates a new instance of the FaceTracker class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Releases all resources used by this FaceTracker.
    `void` | `detectFaces(Image image, TrackedFaceList trackedFaceList)` Detects faces in an image and update their info in a TrackedFaceList object.
    `protected void` | `finalize()` Finalizer for this class.
    `int` | `getConfidenceThreshold()` Gets the confidence threshold, in the range [0;100].
    `FaceModel` | `getDetectionModel()` Gets the model used to detect and track faces.
    `FaceModel` | `getEncodingModel()` Gets the model used to create features and assess consistancy among views of a given face.
    `long` | `getHandle()` Gets the native handle.
    `int` | `getMatchThreshold()` Gets the minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'.
    `int` | `getMaximumTrackedFaceAge()` Gets the maximum number of consecutive non-detections to reach before deleting a tracked face.
    `int` | `getMinimumTrackedFaceAge()` Gets the minimum number of consecutive detections to reach before creating a tracked face.
    `int` | `getNmsIouThreshold()` Gets the non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is [0;100].
    `int` | `getThreadCount()` Gets the number of threads to be used for face detection and tracking.
    `void` | `setConfidenceThreshold(int confidenceThreshold)` Sets the confidence threshold, in the range [0;100].
    `void` | `setDetectionModel(FaceModel detectionModel)` Sets the model used to detect and track faces.
    `void` | `setEncodingModel(FaceModel encodingModel)` Sets the model used to create features and assess consistancy among views of a given face.
    `void` | `setMatchThreshold(int matchThreshold)` Sets the minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'.
    `void` | `setMaximumTrackedFaceAge(int maximumTrackedFaceAge)` Sets the maximum number of consecutive non-detections to reach before deleting a tracked face.
    `void` | `setMinimumTrackedFaceAge(int minimumTrackedFaceAge)` Sets the minimum number of consecutive detections to reach before creating a tracked face.
    `void` | `setNmsIouThreshold(int nmsIouThreshold)` Sets the non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is [0;100].
    `void` | `setThreadCount(int threadCount)` Sets the number of threads to be used for face detection and tracking.
    `void` | `trackFaces(Image image, TrackedFaceList trackedFaceList)` Tracks faces in an image and update their info in a TrackedFaceList object.
    `void` | `warmUp(int imageWidth, int imageHeight)` Gets the face tracker module ready to work on a specific image size by initializing all its internal memory layout.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FaceTracker

          public FaceTracker()
                      throws FaceException

      Creates a new instance of the FaceTracker class.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### FaceTracker

          public FaceTracker(long handle)
                      throws FaceException

      Creates a new instance of the FaceTracker class.
      Parameters:
        `handle` - Handle to the FaceTracker.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

  - ### Method Detail

    - #### close

          public void close()

      Releases all resources used by this FaceTracker.
      Specified by:
        `close` in interface `java.lang.AutoCloseable`

    - #### finalize

          protected void finalize()

      Finalizer for this class. Finalizers are deprecated since Java 9+. This method is not guaranteed to be called. To release all memory held by this class please be sure to call the close() method.
      Overrides:
        `finalize` in class `java.lang.Object`

    - #### getHandle

          public long getHandle()

      Gets the native handle.
      Returns:
        The native handle.

    - #### getConfidenceThreshold

          public int getConfidenceThreshold()
                                     throws FaceException

      Gets the confidence threshold, in the range [0;100]. Hint: Default value is 50. Note: Setting a high threshold reduces false detection but can increase the number of undetected faces.
      Returns:
        Confidence threshold, in the range [0;100].
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setConfidenceThreshold

          public void setConfidenceThreshold(int confidenceThreshold)
                                      throws FaceException

      Sets the confidence threshold, in the range [0;100]. Hint: Default value is 50. Note: Setting a high threshold reduces false detection but can increase the number of undetected faces.
      Parameters:
        `confidenceThreshold` - Confidence threshold, in the range [0;100].
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getDetectionModel

          public FaceModel getDetectionModel()
                                      throws FaceException

      Gets the model used to detect and track faces. Hint: Default value is FaceDetector4B. Note: Some better accuracy/speed balances can be found by choosing another model.
      Returns:
        Model used to detect and track faces.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setDetectionModel

          public void setDetectionModel(FaceModel detectionModel)
                                 throws FaceException

      Sets the model used to detect and track faces. Hint: Default value is FaceDetector4B. Note: Some better accuracy/speed balances can be found by choosing another model.
      Parameters:
        `detectionModel` - Model used to detect and track faces.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getEncodingModel

          public FaceModel getEncodingModel()
                                     throws FaceException

      Gets the model used to create features and assess consistancy among views of a given face. Hint: Default value is FaceEncoder9B. Some better accuracy/speed balances can be found by choosing another model.
      Returns:
        Model used to create features and assess consistancy among views of a given face.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setEncodingModel

          public void setEncodingModel(FaceModel encodingModel)
                                throws FaceException

      Sets the model used to create features and assess consistancy among views of a given face. Hint: Default value is FaceEncoder9B. Some better accuracy/speed balances can be found by choosing another model.
      Parameters:
        `encodingModel` - Model used to create features and assess consistancy among views of a given face.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getMatchThreshold

          public int getMatchThreshold()
                                throws FaceException

      Gets the minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'. Hint: Default value is 3000 which corresponds to a False Match Rate of 1/1000.
      Returns:
        Minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setMatchThreshold

          public void setMatchThreshold(int matchThreshold)
                                 throws FaceException

      Sets the minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'. Hint: Default value is 3000 which corresponds to a False Match Rate of 1/1000.
      Parameters:
        `matchThreshold` - Minimum match score to reach to preserve the ID of a tracked face between frame 't-1' and frame 't'.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getMaximumTrackedFaceAge

          public int getMaximumTrackedFaceAge()
                                       throws FaceException

      Gets the maximum number of consecutive non-detections to reach before deleting a tracked face. Hint: Default value is 30 which corresponds to 2s at a frame rate of 15 FPS. One must adapt this value to its needs in terms of tracker identity memory (in seconds) and measured frame rate on target platform.
      Returns:
        Maximum number of consecutive non-detections to reach before deleting a tracked face.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setMaximumTrackedFaceAge

          public void setMaximumTrackedFaceAge(int maximumTrackedFaceAge)
                                        throws FaceException

      Sets the maximum number of consecutive non-detections to reach before deleting a tracked face. Hint: Default value is 30 which corresponds to 2s at a frame rate of 15 FPS. One must adapt this value to its needs in terms of tracker identity memory (in seconds) and measured frame rate on target platform.
      Parameters:
        `maximumTrackedFaceAge` - Maximum number of consecutive non-detections to reach before deleting a tracked face.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getMinimumTrackedFaceAge

          public int getMinimumTrackedFaceAge()
                                       throws FaceException

      Gets the minimum number of consecutive detections to reach before creating a tracked face. Hint: Default value is 1 for FaceDetector4B since the false detection rate is low enough. If using a less accurate detector (such as FaceDetector3C) one might consider increasing a bit this value to avoid false tracks.
      Returns:
        Minimum number of consecutive detections to reach before creating a tracked face.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setMinimumTrackedFaceAge

          public void setMinimumTrackedFaceAge(int minimumTrackedFaceAge)
                                        throws FaceException

      Sets the minimum number of consecutive detections to reach before creating a tracked face. Hint: Default value is 1 for FaceDetector4B since the false detection rate is low enough. If using a less accurate detector (such as FaceDetector3C) one might consider increasing a bit this value to avoid false tracks.
      Parameters:
        `minimumTrackedFaceAge` - Minimum number of consecutive detections to reach before creating a tracked face.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getNmsIouThreshold

          public int getNmsIouThreshold()
                                 throws FaceException

      Gets the non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is [0;100]. Hint: Default value is 40. Setting a high threshold allows to detect more overlapping faces which can be useful in a multi-face scenario. On the contrary, in a portrait scenario, a low NMS IOU threshold should be preferred.
      Returns:
        Non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is [0;100].
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setNmsIouThreshold

          public void setNmsIouThreshold(int nmsIouThreshold)
                                  throws FaceException

      Sets the non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is [0;100]. Hint: Default value is 40. Setting a high threshold allows to detect more overlapping faces which can be useful in a multi-face scenario. On the contrary, in a portrait scenario, a low NMS IOU threshold should be preferred.
      Parameters:
        `nmsIouThreshold` - Non-maximum suppression (NMS) intersection-over-union (IOU) threshold, in the range is [0;100].
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getThreadCount

          public int getThreadCount()
                             throws FaceException

      Gets the number of threads to be used for face detection and tracking. Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
      Returns:
        Number of threads to be used for face detection and tracking.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### setThreadCount

          public void setThreadCount(int threadCount)
                              throws FaceException

      Sets the number of threads to be used for face detection and tracking. Hint: Default value is 1. Allocating more than one thread can increase the speed of the process.
      Parameters:
        `threadCount` - Number of threads to be used for face detection and tracking.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### detectFaces

          public void detectFaces(Image image,
                                  TrackedFaceList trackedFaceList)
                           throws FaceException

      Detects faces in an image and update their info in a TrackedFaceList object. The algorithm searches for faces in the range [16px;512px]. If the image is too large to fit this range, one must resize it before the tracking process. In a realtime process, one must use this function to keep the face IDs stable in time. Important: Loading a ``FaceDetector`` is required to use this function.
      Parameters:
        `image` - Source image to process.
        `trackedFaceList` - List of tracked faces.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### trackFaces

          public void trackFaces(Image image,
                                 TrackedFaceList trackedFaceList)
                          throws FaceException

      Tracks faces in an image and update their info in a TrackedFaceList object. The algorithm searches for faces in the range [16px;512px]. If the image is too large to fit this range, one must resize it before the tracking process. In a realtime process, one must use this function to keep the face IDs stable in time. Important: Loading a ``FaceDetector`` and a ``FaceEncoder`` model is required to use this function.
      Parameters:
        `image` - Source image to process.
        `trackedFaceList` - List of tracked faces.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### warmUp

          public void warmUp(int imageWidth,
                             int imageHeight)
                      throws FaceException

      Gets the face tracker module ready to work on a specific image size by initializing all its internal memory layout. This function can be called after setting all the parameters of the face detector module if the image size is fixed, for example using frames from a video stream. Calling this function is not mandatory as the internal memory layout is automatically initialized in the first call to detectFaces() or trackFaces() if missing. Important: Loading a ``FaceDetector`` model is required to use this function.
      Parameters:
        `imageWidth` - Width of the expected image size.
        `imageHeight` - Height of expected image size.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

Copyright © id3 Technologies. All rights reserved. eu.id3.face