ARFoundation系列讲解-21图像重新识别

四、图像重新识别

1.环境搭建请移步 ARFoundation系列讲解-16图像跟踪

2.多图识别请移步 ARFoundation系列讲解-17多图像跟踪

3.图片重新识别代码如下:

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.ARFoundation;

/// <summary>重新识别</summary>
public class AnewTracking : MonoBehaviour
{
    private ARTrackedImageManager ImgTrackedManager;
    private Dictionary<string, GameObject> mPrefabs = new Dictionary<string, GameObject>();

    private void Awake()
    {
        ImgTrackedManager = GetComponent<ARTrackedImageManager>();
    }

    private void Start()
    {
        mPrefabs.Add("Rafflesia", Resources.Load("您的模型存放路径") as GameObject);
        mPrefabs.Add("Logo", Resources.Load("您的模型存放路径") as GameObject);
        mPrefabs.Add("QR

猜你喜欢

转载自blog.csdn.net/a451319296/article/details/109585458