Face Pose Data [F200]

Top  Previous  Next

If you enable pose detection (PXC[M]FaceConfiguration.pose.IsEnabled=true), you can use the QueryPose function to retrieve any detected pose data, which includes the following information:

Head Position: Use the QueryHeadPosition to retrieve the head position parameters.
Euler Angles: The Euler angles indicates where the face pose is in terms of rotation along the three axes as illustrated in Figure 18. Use the QueryPoseAngles function to retrieve the Euler angle values.

19: Face Euler Angles Illustration

Position Quaternion: Use the QueryPoseQuaternion to retrieve the face position in the world coordinates.
Rotation Matrix: Use the QueryRotationMatrix to retrieve the rotation matrix that represents the face pose.

Example 47 illustrates the steps to retrieve the face pose data.

C++ Example 47: Retrieve Pose Estimation Data

// fdata is a PXCFaceData instance

pxcI32 nfaces=fdata->QueryNumberOfDetectedFaces();

for (pxcI32 i=0;i<nfaces;i++) {

   // Retrieve the face landmark data instance

   PXCFaceData::Face *face=fdata->QueryFaceByIndex(i);

   PXCFaceData::PoseData *pdata=fdata->QueryPose();

 

   // retrieve the pose information

   PXCFaceData::PoseEulerAngles angles;

   pdata->QueryPoseAngles(&angles);

}

C# Example 47: Retrieve Pose Estimation Data

// fdata is a PXCMFaceData instance

Int32 nfaces=fdata.QueryNumberOfDetectedFaces();

for (Int32 i=0;i<nfaces;i++) {

   // Retrieve the face landmark data instance

   PXCMFaceData.Face face=fdata.QueryFaceByIndex(i);

   PXCMFaceData.PoseData pdata=fdata.QueryPose();

 

   // retrieve the pose information

   PXCMFaceData.PoseEulerAngles angles;

   pdata.QueryPoseAngles(out angles);

}

Java Example 47: Retrieve Pose Estimation Data

// fdata is a PXCMFaceData instance

int nfaces=fdata.QueryNumberOfDetectedFaces();

for (int i=0;i<nfaces;i++) {

   // Retrieve the face landmark data instance

   PXCMFaceData.Face face=fdata.QueryFaceByIndex(i);

   PXCMFaceData.PoseData pdata=fdata.QueryPose();

 

   // retrieve the pose information

   PXCMFaceData.PoseEulerAngles angles=new PXCMFaceData.PoseEulerAngles();

   pdata.QueryPoseAngles(angles);

}