Open oOMoeOo opened 6 years ago
Hi,
onAnchorRemoved()
should be called when the anchor is removed by the underlying system, but it won't get called when a image is simply "out of view". We don't currently have a good way to detect that.onAnchorUpdated()
is invoked/called by the underlying AR system (ARKit). Over time, it does make minute changes to the position/rotation either because the image itself moves or ARKit has a better estimation of the user's own position/rotation and so the position/rotation of the anchor needs to be updated.onAnchorFound|Updated|Removed
on the ViroARScene
or on the ViroARImageMarker
components themselves? We'll have to investigate this one more.onAnchorFound
to the ViroARImageMarker
component and from that, you know which one has been found.Thanks for trying out Viro!
Hi,
do you have any ideas on how to detect whether an image marker is out of view? I'm trying to improve the ar precision by using a mixed marker vs. plane model where objects will bind to a plane in case the marker is currently out of view.
Thanks Moe
Hi @oOMoeOo,
There's not a great way to do this as the AR subsystem doesn't let us know when the marker is no longer "visible". However, what you could do is compute the angle between the camera forward and the last known position of the image marker relative to the camera. If that's greater than say 45 degrees, then most likely the image marker is no longer in the viewport of the camera (as the camera FOV is likely less than that). The FOV of the camera would be per-device dependent if you'd like to be more accurate in your computation (vertical FOV can be different than the horizontal FOV too).
@achuvm Well, i'm wondering why neither arkit nor arcore provide this function. I think it shouldn't be so complicated to determine it in the underlying arkit/scenekit implementation :-)
We're developing an app that requires the user to draw shapes precisely using ar. We need the shape to be in place with a precision of 0-2mm even if the user moves around. This is not possible with plane detection only. That's why we provide the user with multiple image anchors that have to be placed on a surface with fixed distances. We then try to bind the shape to the anchor that is currently in the view (using the difference vector between two related anchors). This is where we need to determine the anchor to view relation. Isn't it just the same as testing if a geometry is in the view?
The idea of tracking the camera angle sounds good but it doesn't take the distance and position of the camera into account. Is there any chance to determine the FOV?
Hi @oOMoeOo,
Yeah, that's a good point. You can try asking for a feature request :).
Yep, that's similar to testing if a geometry is in view. You can get the distance/position of the camera through the getCameraOrientationAsync()
function on the ViroARScene
component. We don't expose this information to the end-user right now. We might expose it in a future update or have a better way to determine if a geometry is in the viewport.
Thanks,
It seems it is now possible to determine in ARCore whether an image marker is currently detected in view or just tracked based on the last known location in the environment by using getTrackingMethod(). Is this already available in ViroReact? I can't find anything in the documentation. Is this planned for upcoming releases? This would be very helpful in our project.
Here are two links where this is mentioned:
https://developers.google.com/ar/develop/java/augmented-images#capabilities
Beginning with ARCore 1.9, you can use getTrackingMethod() to determine whether ARCore is currently tracking the image based on where the image is currently being detected in the camera view (FULL_TRACKING), or based on its most recently detected position in the world (LAST_KNOWN_POSE).
https://developers.google.com/ar/develop/java/augmented-images/guide#supporting_different_use_cases
When ARCore detects an Augmented Image, it creates a Trackable for that Augmented Image and sets TrackingState to TRACKING and TrackingMethod to FULL_TRACKING. When the tracked image moves out of camera view, ARCore changes the TrackingMethod to LAST_KNOWN_POSE while continuing to provide the orientation and position of the image.
Hey @pgims, as @achuvm mentioned in #682, we'll be exposing tracking methods in the next release.
Environment
Please provide the following information about your environment:
Description
Thanks Moe