Tracking Confidence in ARFoundation

Hello!

I’m using ARFoundation to track Markers. My setup is what I think is standard:

. AR Session Origin, AR Tracked Image Manager with Reference Library, AR Session
… AR Camera

Then some other MonoBehaviour subscribes to ARTrackedImageManager.trackedImagesChanged to react whenever there is an image tracked.

My question: how can I get some ‘tracking confidence’ value for these tracked images? I get that there is ARTrackingState, which gives me None, Limited or Tracking. But when this is Tracking, there is still a lot of variety on how good the current tracking estimate is, depending on marker size, distance, lighting, speed relative to the camera, etc.

Is it possible to somehow get a confidence value that tells me how good the tracking estimate is?

I’m deploying only to iOS so could use ARKit functionality (but am not sure at the moment how to do so).

@dominikkoller Hi! I have the same question, did you find anything?

I solved this by adding up the tracked image positions and then averaging them to get a ‘best estimate’ of where the marker is positioned.

          if (trackedImage.trackingState == TrackingState.Tracking)
            {
                TrackedPosition t = new TrackedPosition();
                t.position = trackedImage.transform.position;
                t.rotation = trackedImage.transform.eulerAngles;
                _trackedPositions.Add(t);
            }

            if (_trackedPositions.Count >= m_trackedPositionCount)
            {
                Vector3 pos = Vector3.zero;
                Vector3 rot = Vector3.zero;
                foreach (var trackedPosition in _trackedPositions)
                {
                    pos += trackedPosition.position;
                    rot += trackedPosition.rotation;
                }

                Instantiate(m_prefab, pos/_trackedPositions.Count, Quaternion.Euler(rot/_trackedPositions.Count));
                _trackedImageManager.enabled = false;
            }