首页 > 解决方案 > 应用程序本地的增强图像 [ARCore]

问题描述

我有一个位于本地目录 [drawable 文件夹] 中的图像,所以将此图像放在 ImageView 中,我什至设置了一些与本地图像相对应的本地模型(sfb 对象)。所以我的问题是如何检测页面内的图像?

我的活动 xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 tools:context=".MainActivity">

<FrameLayout
    android:id="@+id/frame_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <fragment
        android:id="@+id/ux_fragment"
        android:name="*****.CustomArFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <ImageView
        android:id="@+id/image_view_news"
        android:layout_width="350dp"
        android:layout_height="500dp"
        android:layout_gravity="center"
        android:src="@drawable/news_paer_image"
        android:visibility="gone" />

</FrameLayout>
</LinearLayout>

在自定义片段上,我已经设置了会话和配置

    Config config = new Config(session);
    config.setUpdateMode(Config.UpdateMode.LATEST_CAMERA_IMAGE);
    config.setFocusMode(Config.FocusMode.AUTO);
    session.configure(config);

    this.getArSceneView().setupSession(session);

    ((MainActivity) getActivity()).setUpNewLetter(config, session);

任何形式的帮助都将不胜感激。

谢谢

标签: androidaugmented-realityarcoresceneform

解决方案


推荐阅读