eu.id3.face

## Class FaceIndexer

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

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

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

  Performs a one-to-many search on a large number of face templates.
  See Also:
    Serialized Form

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addTemplate(FaceTemplate faceTemplate, java.lang.String id)` Adds a template to the Face Indexer.
    `void` | `close()` Releases all resources used by this FaceIndexer.
    `static FaceIndexer` | `create(int maximumTemplateCount, FaceTemplateFormat format)` Creates an empty face indexer
    `void` | `deleteTemplate(java.lang.String id)` Deletes a template from the face indexer.
    `protected void` | `finalize()` Finalizer for this class.
    `static FaceIndexer` | `fromFile(java.lang.String path)` Imports the face indexer object from a file.
    `FaceTemplateFormat` | `getFormat()` Gets the face template format accepted by this face indexer.
    `long` | `getHandle()` Gets the native handle.
    `int` | `getMaximumTemplateCount()` Gets the maximum number of templates that this face indexer can hold.
    `FaceTemplate` | `getTemplate(java.lang.String id)` Retrieves a template from the face indexer by ID.
    `int` | `getTemplateCount()` Gets the current number of indexed templates.
    `void` | `resize(int maximumCount)` Resizes the maximum number of templates that the face indexer can hold.
    `FaceCandidateList` | `searchTemplate(FaceTemplate probe, int maxCandidates)` Performs a one-to-many search of a face template probe against a previously initialized face indexer and outputs a candidate list.
    `void` | `toFile(java.lang.String path)` Saves the face indexer object to a file.

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

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

- - ### Constructor Detail

    - #### FaceIndexer

          public FaceIndexer()
                      throws FaceException

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

    - #### FaceIndexer

          public FaceIndexer(long handle)
                      throws FaceException

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

  - ### Method Detail

    - #### close

          public void close()

      Releases all resources used by this FaceIndexer.
      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.

    - #### getFormat

          public FaceTemplateFormat getFormat()
                                       throws FaceException

      Gets the face template format accepted by this face indexer.
      Returns:
        Face template format accepted by this face indexer.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getMaximumTemplateCount

          public int getMaximumTemplateCount()
                                      throws FaceException

      Gets the maximum number of templates that this face indexer can hold.
      Returns:
        Maximum number of templates that this face indexer can hold.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getTemplateCount

          public int getTemplateCount()
                               throws FaceException

      Gets the current number of indexed templates.
      Returns:
        Current number of indexed templates.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### addTemplate

          public void addTemplate(FaceTemplate faceTemplate,
                                  java.lang.String id)
                           throws FaceException

      Adds a template to the Face Indexer. Note: This function is thread safe with other AddTemplate() calls but not with SearchTemplates() calls.
      Parameters:
        `faceTemplate` - Face template to add to the face indexer.
        `id` - ID of the added face template.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### create

          public static FaceIndexer create(int maximumTemplateCount,
                                           FaceTemplateFormat format)
                                    throws FaceException

      Creates an empty face indexer
      Parameters:
        `maximumTemplateCount` - Maximum number of templates that this face indexer can hold.
        `format` - Face template format accepted by this face indexer.
      Returns:
        The newly created face indexer.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### deleteTemplate

          public void deleteTemplate(java.lang.String id)
                              throws FaceException

      Deletes a template from the face indexer.
      Parameters:
        `id` - ID of the face template to delete.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### fromFile

          public static FaceIndexer fromFile(java.lang.String path)
                                      throws FaceException

      Imports the face indexer object from a file.
      Parameters:
        `path` - Path to the file to import the face indexer object from.
      Returns:
        The newly created face indexer.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getTemplate

          public FaceTemplate getTemplate(java.lang.String id)
                                   throws FaceException

      Retrieves a template from the face indexer by ID.
      Parameters:
        `id` - ID of the required face template.
      Returns:
        The face template.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### resize

          public void resize(int maximumCount)
                      throws FaceException

      Resizes the maximum number of templates that the face indexer can hold.
      Parameters:
        `maximumCount` - Maximum number of templates that this face indexer can hold.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### searchTemplate

          public FaceCandidateList searchTemplate(FaceTemplate probe,
                                                  int maxCandidates)
                                           throws FaceException

      Performs a one-to-many search of a face template probe against a previously initialized face indexer and outputs a candidate list. This function is thread safe with other SearchTemplate() calls but not with AddTemplate() calls.
      Parameters:
        `probe` - The face template probe.
        `maxCandidates` - Maximum number of candidates in the candidate list.
      Returns:
        The list of candidates sorted by decreasing match score.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### toFile

          public void toFile(java.lang.String path)
                      throws FaceException

      Saves the face indexer object to a file.
      Parameters:
        `path` - Path to the file to export the face indexer object to.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

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