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

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

问题描述

我正在尝试阅读并理解 Google ARCore 的域模型,尤其是 Android SDK 包.目前此 SDK 处于预览"模式,因此没有关于如何使用此 API 的教程、博客、文章等.甚至 Google 本身也建议只阅读源代码、源代码注释和 Javadoc 来了解如何使用 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 分量实际上是正确的.所以如果一个锚有一个姿势,我会想象一个姿势也会有一个点云代表锚的坐标 &对这些坐标的信心.但是 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().

PointClouds 是在世界中检测到的 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天全站免登陆