Package cz.fidentis.analyst.landmarks
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):
Canvas.getState()
- Set camera, zoom, show only required face, or use
zoomAndRenderFace(DrawableFace)
recognizeFromImage(int)
Canvas.setState(CanvasState)
-
Method Summary
Modifier and TypeMethodDescriptionstatic LandmarksDetector
getDetector
(Canvas canvas) Creates and returns detector.recognizeFromImage
(int minLandmarks) Detects landmarks from the canvas, usually prepared by the previous call of thezoomAndRenderFace(DrawableFace)
method.recognizeFromMultipleAngles
(int faceSlot, SymmetryConfig symmetryConfig, int minLandmarks, double cameraRotationAngle) Detects landmarks of a face.void
Prepares the scene for a single-face snapshot.
-
Method Details
-
getDetector
Creates and returns detector. Each object instantiates its own face detection AI model automatically.- Parameters:
canvas
- Canvas with the scene. Must not benull
- Returns:
- detector
-
zoomAndRenderFace
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
Detects landmarks from the canvas, usually prepared by the previous call of thezoomAndRenderFace(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 ofzoomAndRenderFace(DrawableFace)
has no effect.- Parameters:
faceSlot
- Scene slot of the face that should be recognizedsymmetryConfig
- Symmetry configuration used to compute the symmetry plane temporarily if the symmetry plane of the face is missing.minLandmarks
- Minimum number of required landmarkscameraRotationAngle
- 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.
-