Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
2.97k stars 1.11k forks source link

[Bug]ARTrackedImage trackedImagesChanged value error #VisionPro #1179

Open linlifeng1995 opened 1 month ago

linlifeng1995 commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce When recognizing images, the update information is wrong. After I recognize a picture, I hold the picture so that it does not appear in the camera, but the picture is still returned in the update.

Expected behavior Uptate will return information that is consistent with the actual situation, or is there any way to clear the currently recognized pictures, because I found that the information returned in add is always correct.

Actual behavior `ARTrackedImageManager m_TrackedImageManager;

void OnEnable() => m_TrackedImageManager.trackedImagesChanged += OnChanged;

void OnDisable() => m_TrackedImageManager.trackedImagesChanged -= OnChanged;

void OnChanged(ARTrackedImagesChangedEventArgs eventArgs) { foreach (var newImage in eventArgs.added) { // Handle added event }

foreach (var updatedImage in eventArgs.updated)
{
    // Handle updated event
}

foreach (var removedImage in eventArgs.removed)
{
    // Handle removed event
}

}` I just follow the official example for image recognition. I get the currently captured object in add and update. Smartphone (please complete the following information):

linlifeng1995 commented 1 month ago

Any help is appreciated :)

esbylan commented 1 month ago

我遇到了一样的问题

camnewnham commented 2 weeks ago

You could check the trackingState of the image -- does it return TrackingState.Limited instead of TrackingState.Tracking ?