Interface LandmarksDetector

All Known Implementing Classes:
LandmarksDetectorImpl

public interface LandmarksDetector
Services for detecting faces and their landmarks from 2D images captured from the canvas. The canvas is modified! Therefore, should its state should be saved and then recovered. Sequence to recognize landmarks from the scene (a single snapshot recognition): Sequence to recognize a single face automatically (snapshots taken from different angles):
  • Method Details

    • getDetector

      static LandmarksDetector getDetector(Canvas canvas)
      Creates and returns detector. Each object instantiates its own face detection AI model automatically.
      Parameters:
      canvas - Canvas with the scene. Must not be null
      Returns:
      detector
    • zoomAndRenderFace

      void zoomAndRenderFace(DrawableFace face)
      Prepares the scene for a single-face snapshot. The scene/canvas is changed! Don't forget to save and recover its state.
      Parameters:
      face - Face to be rendered and later analyzed
    • recognizeFromImage

      List<Landmark> recognizeFromImage(int minLandmarks)
      Detects landmarks from the canvas, usually prepared by the previous call of the zoomAndRenderFace(DrawableFace) method. It is supposed that only one face is visible.
      Parameters:
      minLandmarks - Minimum required landmarks to be detected.
      Returns:
      List of 3D landmarks that were detected from the camera view, an empty list if the required number of landmarks was not found.
    • recognizeFromMultipleAngles

      List<Landmark> recognizeFromMultipleAngles(int faceSlot, SymmetryConfig symmetryConfig, int minLandmarks, double cameraRotationAngle)
      Detects landmarks of a face. Camera is rotated around the selected face (using its symmetry plane) to capture the face from different angles until the required number of landmarks is recognized. The scene is prepared automatically, i.e., previous calls of zoomAndRenderFace(DrawableFace) has no effect.
      Parameters:
      faceSlot - Scene slot of the face that should be recognized
      symmetryConfig - Symmetry configuration used to compute the symmetry plane temporarily if the symmetry plane of the face is missing.
      minLandmarks - Minimum number of required landmarks
      cameraRotationAngle - Angle of camera rotation. If unsure, use 30
      Returns:
      List of 3D landmarks that were detected from the camera view, an empty list if at least required number of landmarks was not found.