I need help with a traking ar proyect in Unity using OpenCV

Hello! I really need help with this, I’m not a programmer and I just know Unity basic things. I’m on an internship and I told my boss that I’m an animator and not a programmer but still he is making me work on this.

It’s my third day reading and looking at the examples on Unity and GitHub and I’m trying my best to understand what’s happening.
This is what I have so far. I’m trying to detect and image on my camera and then track it’s position and display a 3d object on top of it.

using UnityEngine;
using OpenCVForUnity;
using OpenCVForUnity.CoreModule;
using OpenCVForUnity.ImgprocModule;
using OpenCVForUnity.UnityUtils;
using UnityEngine.UI;

public class Junto : MonoBehaviour
{
public RawImage canvasCam;
private WebCamTexture webcamTexture;
public GameObject comida;
public Texture2D marker;
private Mat frameactual;
private Mat result;

void Start()
{
    webcamTexture = new WebCamTexture();

    canvasCam.texture = webcamTexture;
    canvasCam.material.mainTexture = webcamTexture;

    webcamTexture.Play();

    RectTransform rt = canvasCam.GetComponent<RectTransform>();
    //esto es lo que usan los elementos del  UI para su tamano
    rt.sizeDelta = new Vector2(webcamTexture.width, webcamTexture.height);

    frameactual = new Mat(webcamTexture.height, webcamTexture.width, CvType.CV_8UC3);
    result = new Mat();

    comida.SetActive(false);
}

void Update()
{
    Debug.Log(marker.isReadable);
    if (webcamTexture.isPlaying)
    {
        Debug.Log("La camara va andando");

        Texture2D texture = new Texture2D(webcamTexture.width, webcamTexture.height);
        //Frame actual
        texture.SetPixels(webcamTexture.GetPixels()); 
        texture.Apply();
        //obtener y aplicar cambios

        Utils.texture2DToMat(texture, frameactual);

        Mat markerMat = new Mat(marker.height, marker.width, CvType.CV_8UC3);
        Utils.texture2DToMat(marker, markerMat);
        Imgproc.matchTemplate(frameactual, markerMat, result, Imgproc.TM_CCOEFF_NORMED);

        Core.MinMaxLocResult mmr = Core.minMaxLoc(result);
        Point matchLocation = mmr.maxLoc;

        Debug.Log("Tamano del frame" + frameactual.size());
        Debug.Log("Tamano del marker" + markerMat.size());
        Debug.Log("Valor maximo de la coincidencia: " + mmr.maxVal);

        if (mmr.maxVal > 0.8) 
        {
            comida.SetActive(true);

            Vector3 position = new Vector3((float)matchLocation.x, (float)matchLocation.y);
            comida.transform.position = position;

        }
        else 
        {
            comida.SetActive(false);
        }

    }

    else 
    {
        Debug.Log("No hay camara");
    }

}

}

first: what are you supposed to track? show the thing.

matchTemplate is most probably the wrong thing to use, and even more probably the wrong thing if your image comes from a webcam and either of you say “AR” in this context.

What I was tasked to do is to make an object follow an image. This is the one i’m testing this with. I’m really confused whit all this but I want to understad