arfoundation-samples icon indicating copy to clipboard operation
arfoundation-samples copied to clipboard

Runtime Reference Image Tracking is not stable

Open WangChaolun opened this issue 7 years ago • 8 comments

Unity2019.2.12f1 or Unity2019.3.0b10, Xcode11-beta2,AR 3.0-preview4

 var sceneName = SceneManager.GetActiveScene().name.ToLower();
        var abName = sceneName + AssetBundleName;
        if (ABMgr.GetInstance().HasAssetBundle(abName))
        {
            foreach (var assetName in ABMgr.GetInstance().GetAllAssetNames(abName))
            {
                var preference = ABMgr.GetInstance().LoadAsset(abName, assetName) as ARMarkPreference;

                if (preference.name != VersionUtility.Data.Type.ToString()) { continue; }

                var referenceImageLibrary = ABMgr.GetInstance().LoadAsset(preference.ABName, preference.ImageLibraryPath + ".asset") as XRReferenceImageLibrary;
                var runtimeReferenceImageLibrary = manager.CreateRuntimeLibrary() as MutableRuntimeReferenceImageLibrary;

                foreach (var img in referenceImageLibrary)
                {
                    Debug.Log("XRReferenceImage: " + img.texture + " : " + img.name + " : " + img.width);
                    JobHandle jobHandle = runtimeReferenceImageLibrary.ScheduleAddImageJob(img.texture, img.name, img.width);
                    jobHandle.Complete();
                }

                manager.referenceLibrary = runtimeReferenceImageLibrary;
                manager.maxNumberOfMovingImages = preference.MaxNumberOfMovingImages;
                manager.trackedImagePrefab = preference.TrackedImagePrefab;
            }
        }

        if (manager.referenceLibrary != null)
        {
            manager.enabled = true;
            Debug.Log("Tracked Image Enabled!");
        }

Even if I don't move, it will always shake, and the tracking is not as stable as before.

WangChaolun avatar Nov 13 '19 07:11 WangChaolun

Im also having problems with the image tracking, the digital tracker rotates on the x axis sometimes for no reason.

mandivision avatar Nov 13 '19 16:11 mandivision

I too am definitely seeing worse performance using runtime reference images on Android than I do with the old fashioned way

nilsk123 avatar Mar 23 '20 15:03 nilsk123

seeing this as well. I have images that track fine if they are in a static library but then do not get detected if added to the runtime library. although it shows them there. It seems to find the tracking points differently or something along those lines. I also have issues adding images to a runtime library which worked fine if added to a library in the editor.

jiungerich avatar May 25 '20 21:05 jiungerich

I am seeing the same issue. This is crutial to our app development and might be a show-stopper for us. In worsed case we can not use ARFoundation. A stable tracking and working RuntimeReferenceImageLibrary is absolutly needed for us.

I can get everything to track smooth with the serialized, in editor created version of the XRReferenceImageLibrary. But the RuntimeReferenceImageLibrary is messing up the tracking and updating jittery.

Environment:

xcode 11.3.1

Unity editor - 2019.3.11f1

ARCore Extensions - 1.16.0 AR Foundation - 3.1.0-preview.4 ARCore XR Plugin - 3.1.0-preview.4 ARKit XR Plugin - 3.1.0-preview.4 External Dependency Manager for Unity - 1.2.155

lukasrandom avatar Jun 04 '20 18:06 lukasrandom

I stumbled upon the same problem a few days ago and would really appreciate a solution/fix for this problem.

Karol-G avatar Jun 05 '20 07:06 Karol-G

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 15 '20 03:09 stale[bot]

@WangChaolun

Even if I don't move, it will always shake, and the tracking is not as stable as before.

Our image tracking sample now has a button that adds images dynamically, and they do not suffer from this problem (for me, at least). You were using an iOS beta. Is this still an issue today (with non-beta software)?

@jiungerich

I have images that track fine if they are in a static library but then do not get detected if added to the runtime library.

Please see https://github.com/Unity-Technologies/arfoundation-samples/issues/586#issuecomment-693112008 for an explanation for why this might be.

The other issues mentioned in this thread are too vague for me to investigate. If you think you are experiencing an issue that is not explained by my comments above, please create a separate issue.

tdmowrer avatar Sep 17 '20 01:09 tdmowrer

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 24 '20 03:09 stale[bot]