Class Face
java.lang.Object
com.codename1.ai.vision.Face
Portable face observation.
Euler angles are expressed in degrees. Bounds and landmark points use
the normalized, top-left-origin coordinate space defined by
VisionRect and VisionPoint.
-
Constructor Summary
ConstructorsConstructorDescriptionFace(VisionRect bounds, Map<String, VisionPoint> landmarks, float yaw, float pitch, float roll, float smilingProbability, int trackingId) Creates a detected face without backend metadata.Face(VisionRect bounds, Map<String, VisionPoint> landmarks, float yaw, float pitch, float roll, float smilingProbability, int trackingId, VisionMetadata metadata) Creates a detected face with backend diagnostics. -
Method Summary
-
Constructor Details
-
Face
public Face(VisionRect bounds, Map<String, VisionPoint> landmarks, float yaw, float pitch, float roll, float smilingProbability, int trackingId) Creates a detected face without backend metadata.- Parameters:
bounds- face bounds in the oriented image coordinate spacelandmarks- named feature points, defensively copiedyaw- horizontal Euler angle in degreespitch- vertical Euler angle in degreesroll- in-plane Euler angle in degreessmilingProbability- smile confidence, or a negative value when unavailabletrackingId- stable streaming id, or a negative value when unavailable
-
Face
public Face(VisionRect bounds, Map<String, VisionPoint> landmarks, float yaw, float pitch, float roll, float smilingProbability, int trackingId, VisionMetadata metadata) Creates a detected face with backend diagnostics.- Parameters:
bounds- face bounds in the oriented image coordinate spacelandmarks- named feature points, defensively copiedyaw- horizontal Euler angle in degreespitch- vertical Euler angle in degreesroll- in-plane Euler angle in degreessmilingProbability- smile confidence, or a negative value when unavailabletrackingId- stable streaming id, or a negative value when unavailablemetadata- backend details, ornull
-
-
Method Details
-
getBounds
- Returns:
- normalized top-left-origin face bounds
-
getLandmarks
- Returns:
- immutable named landmark map; possibly empty
-
getYaw
public float getYaw()- Returns:
- left/right head rotation in degrees, or 0 if unavailable
-
getPitch
public float getPitch()- Returns:
- up/down head rotation in degrees, or 0 if unavailable
-
getRoll
public float getRoll()- Returns:
- in-plane head rotation in degrees, or 0 if unavailable
-
getSmilingProbability
public float getSmilingProbability()- Returns:
- smile probability in 0..1, or -1 when unavailable
-
getTrackingId
public int getTrackingId()- Returns:
- stream tracking identifier, or -1 when unavailable
-
getMetadata
- Returns:
- backend metadata, or
nullwhen manually constructed
-