Google ARCore 领域模型示例 [英] Google ARCore Domain Model by Example

本文介绍了Google ARCore 领域模型示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试阅读并理解 Google ARCore 的域模型,尤其是 Android SDK 包.目前此 SDK 处于预览"模式,因此没有关于如何使用此 API 的教程、博客、文章等.甚至 Google 本身也建议只阅读源代码、源代码注释和 Javadocs 以了解如何使用 API.问题是:如果你还不是计算机视觉专家,领域模型会感觉有点陌生.你不熟悉.

I'm trying to read and make sense of Google ARCore's domain model, particularly the Android SDK packages. Currently this SDK is in "preview" mode and so there are no tutorials, blogs, articles, etc. available on understanding how to use this API. Even Google itself suggests just reading the source code, source code comments and Javadocs to understand how to use the API. Problem is: if you're not already a computer vision expert, the domain model will feel a little alien & unfamiliar to you.

具体来说,我有兴趣了解以下类之间的基本区别和正确用法:

Specifically I'm interested in understanding the fundamental differences between, and proper usages of, the following classes:

根据Anchor的javadoc:

According to Anchor's javadoc:

"描述现实世界中的一个固定位置和方向.要停留在物理空间中的一个固定位置,这个位置的数值描述会随着ARCore对空间理解的提高而更新.使用getPose()来获取此锚点的当前数字位置.此位置可能会在调用 update() 时随时更改,但不会自发更改."

所以有一个姿势.听起来你放置一个锚点"到相机中可见的东西上,然后 ARCore 跟踪该锚点并不断更新其 Pose 以反映其屏幕坐标的性质?

So Anchors have a Pose. Sounds like you "drop an Anchor" onto something thats visible in the camera, and then ARCore tracks that Anchor and constantly updates its Pose to reflect the nature of its onscreen coordinates maybe?

并且来自Pose的javadoc:

And from Pose's javadoc:

"表示从一个坐标系到另一个坐标系的不可变刚性变换.正如所有 ARCore API 所提供的,姿势总是描述从对象的局部坐标系到世界坐标系的变换(见下文)......这些变化意味着每一帧都应该被认为是在一个完全唯一的世界坐标系中."

所以它听起来Pose 只是相机的当前帧"独有的东西,并且每次帧已更新,所有锚点的所有姿势都可能重新计算?如果不是,那么 Anchor、它的 Pose、当前帧和世界坐标系之间的关系是什么?什么是姿势真的,反正?姿势"是否只是一种存储矩阵/点数据的方式,以便您可以将锚点从当前帧转换为世界帧?还是别的什么?

So it sounds like a Pose is something that is only unique to the "current frame" of the camera and that each time the frame is updated, all poses for all anchors are recalculated maybe? If not, then what's the relationship between an Anchor, its Pose, the current frame and the world coordinate frame? And what's a Pose really, anyways? Is a "Pose" just a way of storing matrix/point data so that you can convert an Anchor from the current frame to the world frame? Or something else?

最后,我看到帧、姿势和锚点之间存在很强的相关性,但还有 PointCloud.我在 com.google.ar.core 中看到的唯一使用这些的类是 Frame.PointClouds 似乎是 (x,y,z) - 坐标,具有代表 ARCore 对 x/y/z 分量实际上正确的信心"的第四个属性.因此,如果 Anchor 有一个 Pose,我会想象一个 Pose 也会有一个 PointCloud 代表 Anchor 的坐标 &对这些坐标的信心.但是 Pose 没有有 PointCloud,所以我一定完全误解了这两个类建模的概念.

Finally, I see a strong correlation between Frames, Poses and Anchors, but then there's PointCloud. The only class I can see inside com.google.ar.core that uses these is the Frame. PointClouds appear to be (x,y,z)-coordinates with a 4th property representing ARCore's "confidence" that the x/y/z components are actually correct. So if an Anchor has a Pose, I would have imagined that a Pose would also have a PointCloud representing the Anchor's coordinates & confidence in those coordinates. But Pose does not have a PointCloud, and so I must be completely misunderstanding the concepts that these two classes model.

我在上面提出了几个不同的问题,但它们都归结为一个简洁、可回答的问题:

I've posed several different questions above, but they all boil down to a single, concise, answerable question:

Frame、Anchor、Pose 和 PointCloud 背后的概念有什么区别?您何时使用它们(以及用于什么目的)?

推荐答案

Pose 是一种结构化的变换.它是从一个坐标系(通常是对象局部)到另一个坐标系(通常是世界)的固定数值转换.

A Pose is a structured transformation. It is a fixed numerical transformation from one coordinate system (typically object local) to another (typically world).

Anchor 表示世界上物理上固定的位置.它的 getPose() 会随着对世界理解的变化而更新.例如,假设您有一栋建筑物,外面有一条走廊.如果您一直绕着走廊走,传感器漂移会导致您不会在开始时的相同坐标处结束.然而,ARCore 可以检测(使用视觉特征)它与启动它的空间相同.发生这种情况时,它会扭曲世界,使您的当前位置和原始位置对齐.作为这种扭曲的一部分,锚点的位置也将被调整,以使它们保持在相同的物理位置.

An Anchor represents a physically fixed location in the world. It's getPose() will update as the understanding of the world changes. For example, imagine you have a building with a hallway around the outside. If you walk all the way around that hallway, sensor drift results in you not winding up at the same coordinates you started at. However, ARCore can detect (using visual features) that it is in the same space it started it. When this happens, it distorts the world so that your current location and original location line up. As part of this distortion, the location of anchors will be adjusted as well so that they stay in the same physical place.

由于这种失真,相对于世界的 Pose 应被视为仅在其返回的帧的持续时间内有效.下次你调用 update() 时,世界可能已经在那个姿势下重新塑造,这可能是无用的.如果您需要将位置保留得比框架长,请创建一个 Anchor.只需确保 removeAnchors() 您不再使用的锚点,因为每个实时锚点都会持续产生成本.

Because of this distortion, a Pose relative to the world should be considered valid only for the duration of the frame during which it was returned. As soon as you call update() the next time, the world may have reshaped at that pose could be useless. If you need to keep a location longer than a frame, create an Anchor. Just make sure to removeAnchors() anchors that you're no longer using, as there is ongoing cost for each live anchor.

Frame 捕捉瞬间的当前状态,并在两次调用 update() 之间变化.

A Frame captures the current state at an instant and changes between two calls to update().

PointCloud 是在世界中检测到的一组 3D 视觉特征点.它们位于自己的本地坐标系中,可以从 Frame.getPointCloudPose() 访问.希望获得比平面检测更好的空间理解的开发人员可以尝试使用点云来了解更多关于 3D 世界的结构.

PointClouds are sets of 3D visual feature points detected in the world. They are in their own local coordinate system, which can be accessed from Frame.getPointCloudPose(). Developers looking to have better spatial understanding than the plane detection provides can try using the point clouds to learn more about the structure of the 3D world.

这有帮助吗?

这篇关于Google ARCore 领域模型示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆