ARKit 的相机空间的方向是什么? [英] What is the orientation of ARKit's camera space?

查看:22
本文介绍了ARKit 的相机空间的方向是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更好地理解在 ARKit 的 ARCamera 转换中的相机坐标空间.

这就是我的画面也就是说,x 轴始终指向设备的长轴,从前置摄像头指向 Home 按钮":

感谢任何帮助,谢谢!

更新:它不会影响这个问题,但为了更清楚,我问这个的原因是因为我有兴趣从 核心位置.在 Core Location 中,如果手机处于竖屏模式,+x 为右,+y 为上,+z 为朝向用户.因此,ARKit 的相机坐标系似乎与 Core Location 中的相机坐标系不同.

解决方案

好吧,正如@Mart10 正确指出的那样,我的初始图表不正确.ARKit 相机上下文中的横向右侧意味着手机处于横向状态,主页按钮位于右侧.这篇博文更详细地解释了这一点.

这意味着相机坐标系约定是,当主页按钮在右侧时为横向:+x:向右,+y:向上,+z:向后.

这与传感器坐标系"不同,后者是x来自 Core Location 的 、y 和 z 地磁数据值进来.传感器坐标系"是,当在右侧有主页按钮的横向时:+x:向上,+y:向左,+z: 落后.您可以使用转换在它们之间切换.

I want to better understand the camera coordinate space that In ARKit's ARCamera tranform is in. In the documentation, it says

This transform creates a local coordinate space for the camera that is constant with respect to device orientation. In camera space, the x-axis points to the right when the device is in UIDeviceOrientation.landscapeRight orientation—that is, the x-axis always points along the long axis of the device, from the front-facing camera toward the Home button. The y-axis points upward (with respect to UIDeviceOrientation.landscapeRight orientation), and the z-axis points away from the device on the screen side.

Following this, the UIDeviceOrientation.landscapeRight documentation says:

The device is in landscape mode, with the device held upright and the home button on the left side.

When I try to understand this, it seems like there is a conflict between "the x-axis points to the right when the device is in UIDeviceOrientation.landscapeRight orientation" and "that is, the x-axis always points along the long axis of the device, from the front-facing camera toward the Home button". The former has +x to the right, and the latter has +x to the left.

Here is how I picture "the x-axis points to the right when the device is in UIDeviceOrientation.landscapeRight orientation":

And this is how I picture "that is, the x-axis always points along the long axis of the device, from the front-facing camera toward the Home button":

Appreciate any help, thanks!

Update: It doesn't impact this question, but to make it more clear, the reason I am asking this is because I am interested in getting the x, y, and z geomagnetic data values from Core Location. In Core Location, if the phone is in Portrait mode, +x is right, +y is up, and +z is towards the user. So it would seem the camera coordinate system for ARKit is different than the camera coordinate system in Core Location.

解决方案

Okay, so my initial diagrams were incorrect, as @Mart10 correctly pointed out. Landscape right in the ARKit Camera context means the phone is in landscape with the home button on the right side. This post explains this in greater detail.

This means the camera coordinate system convention is, when in landscape with the home button on the right side: +x: right, +y: up, +z: backward.

This is different from the "sensor coordinate system", which is the coordinate system that the x, y, and z geomagnetic data values from Core Location come in. The "sensor coordinate system" is, when in landscape with the home button on the right side: +x: up, +y: left, +z: backward. You can use a transform to go between them.

这篇关于ARKit 的相机空间的方向是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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