增强图像类数据为空

时间:2019-04-24 11:27:39

标签: arcore

我正在尝试使用AR-Core android扫描图像并显示3d图像。当我试图从类中获取Augmented-Images时,它会提供空数据。

@RequiresApi(api = Build.VERSION_CODES.N)
    private void onUpdateFrame(FrameTime frameTime) {
        Frame frame = arFragment.getArSceneView().getArFrame();
        System.out.println("frame"+frame.getUpdatedTrackables(AugmentedImage.class));
        Collection<AugmentedImage> augmentedImages = frame.getUpdatedTrackables(AugmentedImage.class);
        System.out.println("update"+augmentedImages);
        for (AugmentedImage augmentedImage : augmentedImages) {
            System.out.println("augmentedimage");
            if (augmentedImage.getTrackingState() == TrackingState.TRACKING) {
                System.out.println("tracked");
                if (augmentedImage.getName().equals("bijoy_keyboard_image") && shouldAddModel) {
                    System.out.println("loading");
                    placeObject(arFragment, augmentedImage.createAnchor(augmentedImage.getCenterPose()), Uri.parse("model.sfb"));
                    shouldAddModel = false;
                }
            }
        }
    }

0 个答案:

没有答案