eu.id3.face

## Class Portrait

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

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

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

  Represents a portrait.
  See Also:
    Serialized Form

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clears all attributes.
    `Portrait` | `clone()` Creates a copy of the Portrait object.
    `void` | `close()` Releases all resources used by this Portrait.
    `protected void` | `finalize()` Finalizer for this class.
    `static Portrait` | `fromBuffer(byte[] data)` Imports the portrait object from a buffer.
    `int` | `getAge()` Gets the estimated age of the subject. -1 if not computed.
    `BackgroundUniformity` | `getBackgroundUniformity()` Gets the result of the background uniformity computation.
    `FaceExpression` | `getExpression()` Gets the estimated expression of the subject (angriness, disgust, fear, happiness, sadness, surprise, or neutral).
    `EyeGaze` | `getEyeGaze()` Gets the estimated gaze.
    `int` | `getFaceId()` Gets the unique face ID.
    `int` | `getFaceMask()` Gets the value indicating whether a face mask is detected.
    `FaceTemplate` | `getFaceTemplate()` Gets the face template.
    `int` | `getGenderMale()` Gets the value indicating whether the subject is a male. -1 if not computed.
    `GeometricAttributes` | `getGeometricAttributes()` Gets the geometric attributes.
    `int` | `getGlasses()` Gets the value indicating whether the subject wears glasses. -1 if not computed.
    `long` | `getHandle()` Gets the native handle.
    `int` | `getHat()` Gets the value indicating whether the subject wears a hat. -1 if not computed.
    `Image` | `getImage()` Gets the source image.
    `Point` | `getImageCenter()` Gets the center of the portrait in the source image.
    `float` | `getImageScale()` Gets the scale to be applied to the source image to display the portrait.
    `Point` | `getImageTranslation()` Gets the translation to be applied to the source image to display the portrait.
    `PortraitInstruction` | `getInstruction()` Gets the instruction to be given to the user for portrait capture.
    `PointList` | `getLandmarks()` Gets the 68-points landmarks.
    `int` | `getLeftEyeOpening()` Gets the value estimating the opening of the left eye. -1 if not computed.
    `int` | `getLeftEyeVisibility()` Gets the value estimating the visibility of the left eye. -1 if not computed.
    `int` | `getLookStraightScore()` Gets the value estimating if the user is looking straight towards the camera. -1 if not computed.
    `int` | `getMakeup()` Gets the value indicating whether makeup is detected. -1 if not computed.
    `int` | `getMouthOpening()` Gets the value indicating estimating the opening of the mouth. -1 if not computed.
    `int` | `getMouthVisibility()` Gets the value estimating the visibility of the mouth. -1 if not computed.
    `int` | `getNoseVisibility()` Gets the value estimating the visibility of the nose. -1 if not computed.
    `int` | `getPadScore()` Gets the score of the presentation attack detection.
    `PadStatus` | `getPadStatus()` Gets the status of the presentation attack detection.
    `PhotographicAttributes` | `getPhotographicAttributes()` Gets the photographic attributes.
    `FacePose` | `getPose()` Gets the face pose.
    `PortraitQualityCheckpoints` | `getQualityCheckpoints()` Gets the quality check points of the portrait.
    `int` | `getQualityScore()` Gets the unified quality score, from 0 to 100. -1 if not computed.
    `int` | `getRightEyeOpening()` Gets the value estimating the opening of the left eye. -1 if not computed.
    `int` | `getRightEyeVisibility()` Gets the value estimating the visibility of the right eye. -1 if not computed.
    `int` | `getSmile()` Gets the value indicating whether the subject is smiling. -1 if not computed.
    `PortraitStatus` | `getStatus()` Gets the status of the portrait.
    `int` | `getSubjectPosition()` Gets the position of the subject in the image.
    `TrackedFace` | `getTrackedFace()` Gets the tracked face.
    `byte[]` | `toBuffer()` Exports the portrait to a buffer.

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

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

- - ### Constructor Detail

    - #### Portrait

          public Portrait()
                   throws FaceException

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

    - #### Portrait

          public Portrait(long handle)
                   throws FaceException

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

  - ### Method Detail

    - #### close

          public void close()

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

    - #### clone

          public Portrait clone()
                         throws FaceException

      Creates a copy of the Portrait object.
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        The newly created Portrait object.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getAge

          public int getAge()
                     throws FaceException

      Gets the estimated age of the subject. -1 if not computed.
      Returns:
        Estimated age of the subject. -1 if not computed.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getBackgroundUniformity

          public BackgroundUniformity getBackgroundUniformity()
                                                       throws FaceException

      Gets the result of the background uniformity computation.
      Returns:
        Result of the background uniformity computation.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getExpression

          public FaceExpression getExpression()
                                       throws FaceException

      Gets the estimated expression of the subject (angriness, disgust, fear, happiness, sadness, surprise, or neutral). Unknown if not computed.
      Returns:
        Estimated expression of the subject (angriness, disgust, fear, happiness, sadness, surprise, or neutral). Unknown if not computed.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getEyeGaze

          public EyeGaze getEyeGaze()
                             throws FaceException

      Gets the estimated gaze.
      Returns:
        Estimated gaze.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getFaceId

          public int getFaceId()
                        throws FaceException

      Gets the unique face ID.
      Returns:
        Unique face ID.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getFaceMask

          public int getFaceMask()
                          throws FaceException

      Gets the value indicating whether a face mask is detected. The range is 0-100, 100 meaning a mask is detected.
      Returns:
        Value indicating whether a face mask is detected. The range is 0-100, 100 meaning a mask is detected.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getFaceTemplate

          public FaceTemplate getFaceTemplate()
                                       throws FaceException

      Gets the face template.
      Returns:
        Face template.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getGenderMale

          public int getGenderMale()
                            throws FaceException

      Gets the value indicating whether the subject is a male. -1 if not computed. The range is 0 (female) -100 (male).
      Returns:
        Value indicating whether the subject is a male. -1 if not computed. The range is 0 (female) -100 (male).
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getGeometricAttributes

          public GeometricAttributes getGeometricAttributes()
                                                     throws FaceException

      Gets the geometric attributes.
      Returns:
        Geometric attributes.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getGlasses

          public int getGlasses()
                         throws FaceException

      Gets the value indicating whether the subject wears glasses. -1 if not computed. The range is 0-100, 100 meaning glasses are detected.
      Returns:
        Value indicating whether the subject wears glasses. -1 if not computed. The range is 0-100, 100 meaning glasses are detected.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getHat

          public int getHat()
                     throws FaceException

      Gets the value indicating whether the subject wears a hat. -1 if not computed. The range is 0-100, 100 meaning a hat is detected.
      Returns:
        Value indicating whether the subject wears a hat. -1 if not computed. The range is 0-100, 100 meaning a hat is detected.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getImage

          public Image getImage()
                         throws FaceException

      Gets the source image.
      Returns:
        Source image.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getImageCenter

          public Point getImageCenter()
                               throws FaceException

      Gets the center of the portrait in the source image.
      Returns:
        Center of the portrait in the source image.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getImageScale

          public float getImageScale()
                              throws FaceException

      Gets the scale to be applied to the source image to display the portrait.
      Returns:
        Scale to be applied to the source image to display the portrait.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getImageTranslation

          public Point getImageTranslation()
                                    throws FaceException

      Gets the translation to be applied to the source image to display the portrait.
      Returns:
        Translation to be applied to the source image to display the portrait.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getInstruction

          public PortraitInstruction getInstruction()
                                             throws FaceException

      Gets the instruction to be given to the user for portrait capture.
      Returns:
        Instruction to be given to the user for portrait capture.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getLandmarks

          public PointList getLandmarks()
                                 throws FaceException

      Gets the 68-points landmarks.
      Returns:
        68-points landmarks.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getLeftEyeOpening

          public int getLeftEyeOpening()
                                throws FaceException

      Gets the value estimating the opening of the left eye. -1 if not computed. The range is 0-100, 100 meaning the eye is fully opened.
      Returns:
        Value estimating the opening of the left eye. -1 if not computed. The range is 0-100, 100 meaning the eye is fully opened.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getLeftEyeVisibility

          public int getLeftEyeVisibility()
                                   throws FaceException

      Gets the value estimating the visibility of the left eye. -1 if not computed. The range is 0-100, 100 meaning the left eye is fully visible.
      Returns:
        Value estimating the visibility of the left eye. -1 if not computed. The range is 0-100, 100 meaning the left eye is fully visible.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getLookStraightScore

          public int getLookStraightScore()
                                   throws FaceException

      Gets the value estimating if the user is looking straight towards the camera. -1 if not computed. The range is 0-100, 100 meaning the look is straight.
      Returns:
        Value estimating if the user is looking straight towards the camera. -1 if not computed. The range is 0-100, 100 meaning the look is straight.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getMakeup

          public int getMakeup()
                        throws FaceException

      Gets the value indicating whether makeup is detected. -1 if not computed. The range is 0-100, 100 meaning makeup is detected.
      Returns:
        Value indicating whether makeup is detected. -1 if not computed. The range is 0-100, 100 meaning makeup is detected.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getMouthOpening

          public int getMouthOpening()
                              throws FaceException

      Gets the value indicating estimating the opening of the mouth. -1 if not computed. The range is 0-100, 100 meaning the mouth is fully open.
      Returns:
        Value indicating estimating the opening of the mouth. -1 if not computed. The range is 0-100, 100 meaning the mouth is fully open.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getMouthVisibility

          public int getMouthVisibility()
                                 throws FaceException

      Gets the value estimating the visibility of the mouth. -1 if not computed. The range is 0-100, 100 meaning the mouth is fully visible.
      Returns:
        Value estimating the visibility of the mouth. -1 if not computed. The range is 0-100, 100 meaning the mouth is fully visible.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getNoseVisibility

          public int getNoseVisibility()
                                throws FaceException

      Gets the value estimating the visibility of the nose. -1 if not computed. The range is 0-100, 100 meaning the nose is fully visible.
      Returns:
        Value estimating the visibility of the nose. -1 if not computed. The range is 0-100, 100 meaning the nose is fully visible.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getPadScore

          public int getPadScore()
                          throws FaceException

      Gets the score of the presentation attack detection.
      Returns:
        Score of the presentation attack detection.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getPadStatus

          public PadStatus getPadStatus()
                                 throws FaceException

      Gets the status of the presentation attack detection.
      Returns:
        Status of the presentation attack detection.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getPhotographicAttributes

          public PhotographicAttributes getPhotographicAttributes()
                                                           throws FaceException

      Gets the photographic attributes.
      Returns:
        Photographic attributes.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getPose

          public FacePose getPose()
                           throws FaceException

      Gets the face pose.
      Returns:
        Face pose.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getQualityCheckpoints

          public PortraitQualityCheckpoints getQualityCheckpoints()
                                                           throws FaceException

      Gets the quality check points of the portrait.
      Returns:
        Quality check points of the portrait.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getQualityScore

          public int getQualityScore()
                              throws FaceException

      Gets the unified quality score, from 0 to 100. -1 if not computed.
      Returns:
        Unified quality score, from 0 to 100. -1 if not computed.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getRightEyeOpening

          public int getRightEyeOpening()
                                 throws FaceException

      Gets the value estimating the opening of the left eye. -1 if not computed. The range is 0-100, 100 meaning the eye is fully opened.
      Returns:
        Value estimating the opening of the left eye. -1 if not computed. The range is 0-100, 100 meaning the eye is fully opened.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getRightEyeVisibility

          public int getRightEyeVisibility()
                                    throws FaceException

      Gets the value estimating the visibility of the right eye. -1 if not computed. The range is 0-100, 100 meaning the right eye is fully visible.
      Returns:
        Value estimating the visibility of the right eye. -1 if not computed. The range is 0-100, 100 meaning the right eye is fully visible.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getSmile

          public int getSmile()
                       throws FaceException

      Gets the value indicating whether the subject is smiling. -1 if not computed. The range is 0-100, 100 meaning the person is smiling.
      Returns:
        Value indicating whether the subject is smiling. -1 if not computed. The range is 0-100, 100 meaning the person is smiling.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getStatus

          public PortraitStatus getStatus()
                                   throws FaceException

      Gets the status of the portrait.
      Returns:
        Status of the portrait.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getSubjectPosition

          public int getSubjectPosition()
                                 throws FaceException

      Gets the position of the subject in the image.
      Returns:
        Position of the subject in the image.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### getTrackedFace

          public TrackedFace getTrackedFace()
                                     throws FaceException

      Gets the tracked face.
      Returns:
        Tracked face.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### clear

          public void clear()
                     throws FaceException

      Clears all attributes.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### fromBuffer

          public static Portrait fromBuffer(byte[] data)
                                     throws FaceException

      Imports the portrait object from a buffer.
      Parameters:
        `data` - Buffer to import the portrait object from.
      Returns:
        The newly created portrait.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

    - #### toBuffer

          public byte[] toBuffer()
                          throws FaceException

      Exports the portrait to a buffer.
      Returns:
        The buffer to which the portrait object is exported.
      Throws:
        `FaceException` - An error has occurred during Face Library execution.

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