我是Arcore的新手,我尝试使用它编写一个Android应用程序。
我要做的是根据悬挂在墙上固定位置的增强图像来估算当前位置。
这样做类似的应用程序是例如: https://www.youtube.com /watch?v = eqxkenrhmxw
我想拥有一个环境,一切都处于预定义的位置。该应用程序的输入将是:
- 图1悬挂在姿势1
- 图片2挂在姿势2
- 图3上挂在姿势3
- 对象4应在姿势4显示
输入是一致的。
首先,我将“ Hello AR”应用程序作为起点。
我创建了一个增强模构的阿塔布群,并在其中添加了图像,并能够像这里的文档中所述检测它们:
https://developers.google.com/ar//ar/开发/java/增强图像/指南?hl = en
到这一点的行为是,应用程序启动的姿势被视为原点,图片姿势与该来源有关。
如何将预定义的姿势附加到扫描的图像上?结果改变了用户的姿势?这样我就可以在预定义的位置显示对象?
还是该问题存在哪个行走?
其他问题:在说:
“如果您的图像永远不会从其初始位置移动(例如,将海报固定在墙上),则可以将全局锚点附加到图像上以增加跟踪稳定性。”
我在文档中找不到任何内容。以下是这样做的方式吗?
val centerPose = img.centerPose
val anchor = session.createAnchor(centerPose)
我非常感谢您的回答。
I am new to ARCore and I try to write an Android app using it.
What I want to do is to estimate the current position based on augmented images that hang at a fixed place on a wall.
An app which does something like this is for example this one: https://www.youtube.com/watch?v=eQXKEnrHMxw
I want to have an environment where everything is at a predefined position. The input of the app will be for example:
- Picture 1 hangs at Pose 1
- Picture 2 hangs at Pose 2
- Picture 3 hangs at Pose 3
- Object 4 should be displayed at Pose 4
The input can be considered consistent.
To start, I took the "Hello AR" app as a starting point.
I created an AugmentedImageDatabase and added images to it and am able to detect them like described in the docs here:
https://developers.google.com/ar/develop/java/augmented-images/guide?hl=en
The behavior until this point is, that the Pose where the app starts is considered the origin and the pictures pose is detected in relation to this origin.
How can I attach a predefined pose to the scanned image? And as a result change the Pose of the user? So that I can display an object at the predefined position?
Or which walkaround exists for that problem?
Additional question: In the docs under https://developers.google.com/ar/develop/augmented-images?hl=en is said:
"If your image will never move from its initial position (for example, a poster affixed to a wall), you can attach a global anchor to the image to increase tracking stability."
I couldn't find anything about it in the docs. Is the following the way to do it?
val centerPose = img.centerPose
val anchor = session.createAnchor(centerPose)
I'm very thankful for your answers.
发布评论