Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why getAllTrackables method return only one face?

I'm running the arcore sample of new version (1.7.0).

In the sample of AugmentedFace, why below statement return only one face?

Collection<AugmentedFace> faceList =
          sceneView.getSession().getAllTrackables(AugmentedFace.class);

Did I miss something? or is it just kind of limitation?

like image 383
magiceye02 Avatar asked Sep 18 '26 18:09

magiceye02


1 Answers

ARCore's Augmented Faces feature was designed to work primarily with one face. But you can use it for more faces.

// Get a list of detected faces.
Collection<AugmentedFace> faceList = session.getAllTrackables(AugmentedFace.class);


for (AugmentedFace face : faceList) {

    // Create a face nodes and add it to the scene.
    AugmentedFaceNode faceNode1 = new AugmentedFaceNode(face);
    AugmentedFaceNode faceNode2 = new AugmentedFaceNode(face);
    faceNode1.setParent(scene);
    faceNode2.setParent(scene);

    // Overlay the 3D assets on faces.
    faceNode1.setFaceRegionsRenderable(faceRegionsRenderable1);
    faceNode2.setFaceRegionsRenderable(faceRegionsRenderable2);

    // Overlay textures on faces.
    faceNode1.setFaceMeshTexture(faceMeshTexture1);
    faceNode2.setFaceMeshTexture(faceMeshTexture2);
}
like image 59
Andy Jazz Avatar answered Sep 20 '26 08:09

Andy Jazz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!