1

I am trying to extract the model view matrix for each face landmark returned by mediapipe just like what we can do with ARCore as in here so that I can render a 3D object at an exact landmark.

Using the face geometry example of mediapipe, I can extract the face geometry, and get a rough estimate translation for each landmark point by accessing the corresponding index from VertexBufferList:

                    List<FaceGeometry> multiFaceGeometry =
                            PacketGetter.getProtoVector(packet, FaceGeometry.parser());
                    // Get x, y, z translation to landmark 100
                    x = multiFaceGeometry.get(0).getMesh().getVertexBufferList().get(100*5 + 0);
                    y = multiFaceGeometry.get(0).getMesh().getVertexBufferList().get(100*5 + 1);
                    z = multiFaceGeometry.get(0).getMesh().getVertexBufferList().get(100*5 + 2);

                    MatrixData poseTransformMatrix = multiFaceGeometry.get(0).getPoseTransformMatrix();
                    Matrix.translateM(poseTransformMatrix, 0, x, y, z);

However, the problem is that when I try to move my face, the landmark position got incorrect. In ARCore, I can get a nice and precise landmark position just by getting the centerPose and then translate by x, y, z like above. So my question is that is there any way to get a precise model view matrix for each landmark point returned by mediapipe?

Nguyen Cong
  • 174
  • 1
  • 13

0 Answers0