.. index:: 
  !FaceAnalyser Class

.. _id3_face_face_analyser_class:

===============================================================================
FaceAnalyser Class
===============================================================================

Namespace: :ref:`id3.Face<reference_face>`

.. toctree::
  :hidden:

  applyAlphaMask<apply_alpha_mask>
  applyMask<apply_mask>
  checkColorizedImage<check_colorized_image>
  computeAge<compute_age>
  computeAttributes<compute_attributes>
  computeBackgroundUniformity<compute_background_uniformity>
  computeExpression<compute_expression>
  computeEyeGaze<compute_eye_gaze>
  computeEyeOpenness<compute_eye_openness>
  computeEyeRedness<compute_eye_redness>
  computeGeometricAttributes<compute_geometric_attributes>
  computeGlassesAttributes<compute_glasses_attributes>
  computeLandmarks<compute_landmarks>
  computeNoise<compute_noise>
  computePhotographicAttributes<compute_photographic_attributes>
  computePose<compute_pose>
  computePoseWithLandmarks<compute_pose_with_landmarks>
  detectFaceMask<detect_face_mask>
  detectOcclusions<detect_occlusions>
  expressionSensibility<expression_sensibility>
  overExposureSensibility<over_exposure_sensibility>
  removeCompressionArtifacts<remove_compression_artifacts>
  segmentBackground<segment_background>
  segmentFace<segment_face>
  threadCount<thread_count>
  underExposureSensibility<under_exposure_sensibility>


Definition
----------
.. line-block::
    Provides methods for analysing the characteristics of portrait image.

.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        class FaceAnalyser

    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        class FaceAnalyser implements Finalizable

    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        public partial class FaceAnalyser

    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        public class FaceAnalyser implements AutoCloseable, Serializable

    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        public class FaceAnalyser

    .. tab-item:: C
      :sync: C

      .. code:: C

        typedef struct id3FaceAnalyser *ID3_FACE_ANALYSER;



Usage
-----

.. tab-set::

    .. tab-item:: Python
      :sync: Python

      .. code:: Python

        faceAnalyserInstance = id3face.FaceAnalyser()

      **Explicit destruction**

      .. code:: Python

        # ...
        del faceAnalyserInstance

    .. tab-item:: Dart
      :sync: Dart

      .. code:: Dart

        final faceAnalyserInstance = sdk.FaceAnalyser();
        // ...

      **Explicit destruction**

      .. code:: Dart

        // ...
        faceAnalyserInstance.dispose()

    .. tab-item:: C#
      :sync: C#

      .. code:: C#

        using (var faceAnalyserInstance = new FaceAnalyser())
        {
           // ...
        }

      **Explicit destruction**

      .. code:: C#

        var faceAnalyserInstance = new FaceAnalyser()
        // ...
        faceAnalyserInstance.Dispose()

    .. tab-item:: Java
      :sync: Java

      .. code:: Java

        try (FaceAnalyser faceAnalyserInstance = new FaceAnalyser()) {
        // ...
        }

      **Explicit destruction**

      .. code:: Java

        FaceAnalyser faceAnalyserInstance = new FaceAnalyser();
        // ...
        faceAnalyserInstance.close();

    .. tab-item:: Swift
      :sync: Swift

      .. code:: Swift

        private var faceAnalyserInstance: FaceAnalyser? = nil
        faceAnalyserInstance = try FaceAnalyser()

    .. tab-item:: C
      :sync: C

      .. code:: C

        ID3_FACE_ANALYSER hFaceAnalyser{};
        int err = id3FaceAnalyser_Initialize(&hFaceAnalyser);
        if (err == ID3_SUCCESS) {
            // ...
            id3FaceAnalyser_Dispose(&hFaceAnalyser);
        }


Properties
----------

.. list-table:: 
  :width: 100%
  :widths: 30 5 65
  :header-rows: 1

  * - Name
    - Type
    - Description
  * - :ref:`expressionSensibility<id3_face_face_analyser_expression_sensibility_class_member>`
    - int
    - Sensibility of the expression classifier.
  * - :ref:`overExposureSensibility<id3_face_face_analyser_over_exposure_sensibility_class_member>`
    - int
    - Sensibility of the over-exposure classifier, from 0 to 255.
  * - :ref:`threadCount<id3_face_face_analyser_thread_count_class_member>`
    - int
    - Number of threads to be used for face analysis.
  * - :ref:`underExposureSensibility<id3_face_face_analyser_under_exposure_sensibility_class_member>`
    - int
    - Sensibility of the under-exposure classifier, from 0 to 255.

Methods
-------

.. list-table:: 
  :width: 100%
  :widths: 30 70
  :header-rows: 1

  * - Name
    - Description
  * - :ref:`applyAlphaMask<id3_face_face_analyser_apply_alpha_mask_class_method>`
    - Applies an alpha mask to suppress the background and returns a 32-bit BGRA image.
  * - :ref:`applyMask<id3_face_face_analyser_apply_mask_class_method>`
    - Applies a mask to replace the background with the specified color and returns a 24-bit BGR image.
  * - :ref:`checkColorizedImage<id3_face_face_analyser_check_colorized_image_class_method>`
    - Verifies if an image is colorized or grayscale.
  * - :ref:`computeAge<id3_face_face_analyser_compute_age_class_method>`
    - Computes the age of a detected face.
  * - :ref:`computeAttributes<id3_face_face_analyser_compute_attributes_class_method>`
    - Computes the attributes of a detected face.
  * - :ref:`computeBackgroundUniformity<id3_face_face_analyser_compute_background_uniformity_class_method>`
    - Computes the background uniformity behind a detected face.
  * - :ref:`computeExpression<id3_face_face_analyser_compute_expression_class_method>`
    - Computes the expression of a detected face.
  * - :ref:`computeEyeGaze<id3_face_face_analyser_compute_eye_gaze_class_method>`
    - Computes the eye gaze of a detected face.
  * - :ref:`computeEyeOpenness<id3_face_face_analyser_compute_eye_openness_class_method>`
    - Computes the eye openness of a detected face.
  * - :ref:`computeEyeRedness<id3_face_face_analyser_compute_eye_redness_class_method>`
    - Computes the eye redness of a detected face.
  * - :ref:`computeGeometricAttributes<id3_face_face_analyser_compute_geometric_attributes_class_method>`
    - Computes the geometric attributes of a detected face. This function must be used for a portrait image with only one face in it.
  * - :ref:`computeGlassesAttributes<id3_face_face_analyser_compute_glasses_attributes_class_method>`
    - Computes the glasses attributes of a detected face. This function must be used for a portrait image with only one face in it.
  * - :ref:`computeLandmarks<id3_face_face_analyser_compute_landmarks_class_method>`
    - Computes 68 landmarks of a detected face.
  * - :ref:`computeNoise<id3_face_face_analyser_compute_noise_class_method>`
    - Measures the image noise.
  * - :ref:`computePhotographicAttributes<id3_face_face_analyser_compute_photographic_attributes_class_method>`
    - Computes the photographic attributes of a detected face. This function must be used for a portrait image with only one face in it.
  * - :ref:`computePose<id3_face_face_analyser_compute_pose_class_method>`
    - Computes the pose of a detected face.
  * - :ref:`computePoseWithLandmarks<id3_face_face_analyser_compute_pose_with_landmarks_class_method>`
    - Computes the pose of a detected face using the specified 68-point landmarks.
  * - :ref:`detectFaceMask<id3_face_face_analyser_detect_face_mask_class_method>`
    - Detects the presence of a face mask on a detected face.
  * - :ref:`detectOcclusions<id3_face_face_analyser_detect_occlusions_class_method>`
    - Detects occlusions on the subject's face.
  * - :ref:`removeCompressionArtifacts<id3_face_face_analyser_remove_compression_artifacts_class_method>`
    - Upscale and enhance the image of a face.
  * - :ref:`segmentBackground<id3_face_face_analyser_segment_background_class_method>`
    - Computes face segmentation mask for background removal.
  * - :ref:`segmentFace<id3_face_face_analyser_segment_face_class_method>`
    - Computes a segmentation map of a face.
