.. index:: 
  !FaceAnalyser.computeEyeRedness Method
  
.. _id3_face_face_analyser_compute_eye_redness_class_method:

===============================================================================
FaceAnalyser.computeEyeRedness Method
===============================================================================

Module: :ref:`FaceAnalyser<id3_face_face_analyser_class>`

Definition
----------

Computes the eye redness of a detected face.

The maximum recommanded value for an ICAO-compliant portrait is 10.

.. important:: Loading the ``EyeRednessDetector`` model is required to use this function.


.. tab-set::

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

      .. code:: Python

        compute_eye_redness(self, image: Image, detected_face: DetectedFace, landmarks: PointList) -> List[int]

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detected_face`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``landmarks`` :ref:`PointList<id3_face_point_list_class>`
          :guilabel:`in` Estimated landmarks of the detected face. Must be computed with the face analyser.


      **Returns**

        .. line-block::

          ``List[int]``
          The estimated redness scores of left and right eyes of the detected face in this order.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


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

      .. code:: Dart

        List<int> computeEyeRedness(Image image, DetectedFace detectedFace, PointList landmarks)

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``landmarks`` :ref:`PointList<id3_face_point_list_class>`
          :guilabel:`in` Estimated landmarks of the detected face. Must be computed with the face analyser.


      **Returns**

        .. line-block::

          ``List<int>``
          The estimated redness scores of left and right eyes of the detected face in this order.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


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

      .. code:: C#

        public int[] ComputeEyeRedness(Image image, DetectedFace detectedFace, PointList landmarks)

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``landmarks`` :ref:`PointList<id3_face_point_list_class>`
          :guilabel:`in` Estimated landmarks of the detected face. Must be computed with the face analyser.


      **Returns**

        .. line-block::

          ``int[]``
          The estimated redness scores of left and right eyes of the detected face in this order.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


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

      .. code:: Java

        public int[] computeEyeRedness(Image image, DetectedFace detectedFace, PointList landmarks) throws FaceException

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``landmarks`` :ref:`PointList<id3_face_point_list_class>`
          :guilabel:`in` Estimated landmarks of the detected face. Must be computed with the face analyser.


      **Returns**

        .. line-block::

          ``int[]``
          The estimated redness scores of left and right eyes of the detected face in this order.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


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

      .. code:: Swift

        public func computeEyeRedness(image: Image, detectedFace: DetectedFace, landmarks: PointList) throws -> [Int32]

      **Parameters**

        .. line-block::

          ``image`` :ref:`Image<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``detectedFace`` :ref:`DetectedFace<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``landmarks`` :ref:`PointList<id3_face_point_list_class>`
          :guilabel:`in` Estimated landmarks of the detected face. Must be computed with the face analyser.


      **Returns**

        .. line-block::

          ``[Int]``
          The estimated redness scores of left and right eyes of the detected face in this order.

      **Exceptions**

        .. line-block::

          :ref:`FaceException<id3_face_face_exception>`
          An error has occurred during Face Library execution.


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

      .. code:: C

        int id3FaceAnalyser_ComputeEyeRedness (
            ID3_FACE_ANALYSER hFaceAnalyser, 
            ID3_FACE_IMAGE hImage, 
            ID3_DETECTED_FACE hDetectedFace, 
            ID3_FACE_POINT_LIST hLandmarks, 
            int * eyeRednessScores, 
            int * eyeRednessScoresSize)

      **Parameters**

        .. line-block::

          ``hFaceAnalyser`` :ref:`ID3_FACE_ANALYSER<id3_face_face_analyser_class>`
          :guilabel:`in` Handle to the FaceAnalyser object.

          ``hImage`` :ref:`ID3_FACE_IMAGE<id3_face_image_class>`
          :guilabel:`in` Source image to process.

          ``hDetectedFace`` :ref:`ID3_DETECTED_FACE<id3_face_detected_face_class>`
          :guilabel:`in` Detected face to process.

          ``hLandmarks`` :ref:`ID3_FACE_POINT_LIST<id3_face_point_list_class>`
          :guilabel:`in` Estimated landmarks of the detected face. Must be computed with the face analyser.

          ``eyeRednessScores`` int *
          :guilabel:`out` The estimated redness scores of left and right eyes of the detected face in this order.

          ``eyeRednessScoresSize`` int *
          :guilabel:`in` Size of the 'eyeRednessScores' buffer. Receives the number of elements in the 'eyeRednessScores' array.


      **Returns**

        .. line-block::

          ``int``
          An error code.
          See :ref:`id3FaceError<id3_face_face_error_enum>` file for the list of possible error codes.


