runtime Image tracking works only in first 5 seconds
a
auslin zegerl
started a topic
over 2 years ago
Hello We are making runtime tracker with zip in Unity. It is works only in first 5 seconds. Yes it works but only in first 5 seconds. There is no error. We can recognize image if we show it immediately after scene start. If it did not recognize by then it will stop tracking. I made i screen record to show. You can see in the video. First stuck frame is it is creating zip file. When it is done you will see recording is smooth. After five seconds you will see fps drops too low. This is shows it stopped tracking. And it is only on iphones not supported arkit. How can this happen?
public void OnLoadTracker()
{
ZipTrackers();
if (_isLoadingTracker) {
return;
}
if (_currentTracker != null) {
Destroy(_currentTracker.gameObject);
}
_isLoadingTracker = true;
GameObject trackerObject = new GameObject("ImageTracker");
_currentTracker = trackerObject.AddComponent<ImageTracker>();
_currentTracker.TargetSourceType = TargetSourceType.TargetCollectionResource;
_currentTracker.TargetCollectionResource = new TargetCollectionResource();
_currentTracker.TargetCollectionResource.UseCustomURL = true;
_currentTracker.TrackerEfficiencyMode = TrackerEfficiencyMode.EnergyEfficiency;
_currentTracker.MaximumNumberOfConcurrentTrackableTargets = 10; // does not matter if 1 or 10
if (File.Exists(Path.Combine(Application.persistentDataPath, "runtime.zip")))
{
string url = "file://" + Path.Combine(Application.persistentDataPath, "runtime.zip");
print(url);
#if UNITY_EDITOR
//url = Path.Combine(Application.persistentDataPath, "runtime.zip");
#endif
_currentTracker.TargetCollectionResource.TargetPath = url;
_currentTracker.TargetCollectionResource.OnFinishLoading.AddListener(OnFinishLoading);
_currentTracker.TargetCollectionResource.OnErrorLoading.AddListener(OnErrorLoading);
_currentTracker.OnTargetsLoaded.AddListener(OnTargetsLoaded);
_currentTracker.OnErrorLoadingTargets.AddListener(OnErrorLoadingTargets);
_currentTracker.OnInitializationError.AddListener(OnInitializationError);
//GameObject trackableObject = GameObject.Instantiate(TrackablePrefab);
if (trackableObject != null) {
Destroy(trackableObject.gameObject);
}
trackableObject = new GameObject("test");
trackableObject.transform.SetParent(_currentTracker.transform, false);
trackableObject.AddComponent<ImageTrackable>();
//trackableObject.GetComponent<ImageTrackable>().OnImageRecognized.RemoveAllListeners();
trackableObject.GetComponent<ImageTrackable>().OnImageLost.AddListener(imgLost);
trackableObject.GetComponent<ImageTrackable>().OnImageRecognized.AddListener(imgFound);
trackableObject.GetComponent<ImageTrackable>().OnImageRecognized.AddListener(ImageRecognized)
}
else
{
OnLoadTracker();
}
}
auslin zegerl
Hello We are making runtime tracker with zip in Unity. It is works only in first 5 seconds. Yes it works but only in first 5 seconds. There is no error. We can recognize image if we show it immediately after scene start. If it did not recognize by then it will stop tracking. I made i screen record to show. You can see in the video. First stuck frame is it is creating zip file. When it is done you will see recording is smooth. After five seconds you will see fps drops too low. This is shows it stopped tracking. And it is only on iphones not supported arkit. How can this happen?
Huawei P9 Lite 2017 Android 8 (works fine)
MacOS(Garbage performance on vmware works fine)
iPhone 6 (12.4.5) Does not work.