Android: Unable to detect vertical plane

ε祈祈猫儿з 提交于 2019-12-02 07:19:39

Firstly, you need an appropriate vertical surface for tracking. Wall with a solid color (with no distinguishing features on it) is very bad instance. The most robust approach for tracking of a vertical surface is a well lit brick wall, or a wall with pictures on it, etc.

Secondly, the easiest way of creating an Anchor in the center of your detected plane is to use the following code (make sure you call it once, so it couldn't create a new Anchor on every update):

Anchor newAnchor;

for (Plane plane : mSession.getAllTrackables(Plane.class)) {

    if (plane.getType() == Plane.Type.VERTICAL &&
        plane.getTrackingState() == TrackingState.TRACKING) {

        newAnchor = plane.createAnchor(plane.getCenterPose());
        break;
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!