Face Pose
Analyzes face rotation and position of a face in a video stream. The event listener continuously gets the data in a JSON object as FaceAI detects face rotation in a video stream. The face rotation angle data is represented in terms of radiants as Pitch, Roll, and Yaw.
Method
To start or stop analysis of face rotation and position in a video stream.
- Class:
EnxFaceAI
- Method:
public void onFacePoseData(String type, String value)
Parameters
enable
: Boolean. Set it to true to enable or start the analysis of face pose. Otherwise, set it to false.
Callback Method
onFacePoseData
: This method is received repeatedly with the Face Rotation & Position Analysis report as a JSON object.
JSON Object: Received with Face Rotation & Position Analysis data.
{ output: {pose: {pitch: Number,roll: Number,yaw: Number}}}
Analysis Data Explanation
output
: Face Rotation & Position Reportpose
: Filtered (smoothened) pose rotation angles expressed in radiants aspitch
,roll
andyaw
.
Note: The maximum and minimum ranges for rotation angles are currently limited to +- (Pi/2) in radians, corresponding to +- (90°) in degrees, for each of the 3 axes. The zero point is when a face looks straight at the camera.
Sample Code
enxFaceAI.enableFacePose(true); // To start analysisenxFaceAI.enableFacePose(false); // To stop analysis// Callback@Overridepublic void onFacePoseData(String type, String value) {}