我可以使用 ARKit 一次跟踪 4 张以上的图像吗? [英] Can I track more than 4 images at a time with ARKit?

查看:21
本文介绍了我可以使用 ARKit 一次跟踪 4 张以上的图像吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开箱即用,很明显 ARKit 不允许一次跟踪超过 4 个图像.(您可以跟踪"更多的标记,但一次只能使用 4 个).见

我相信此功能并非偶尔会受到 Cupertino 软件工程师的限制.ARImageAnchor 子类继承自 ARAnchor 父类并符合 ARTrackable 协议,因此它不仅可以跟踪静态图像,还可以跟踪动态图像(例如汽车车身上的标志).因此,如果您跟踪超过 4 张图像 - 它是高度 CPU/GPU 密集型的(消耗手机电池的最臭名昭著的事情),导致您的设备必须检测和跟踪多个不同的对象.

我想可以使用更新的 ARKit 4.0 版本同时跟踪 4 个以上的图像,该版本可以在相当强大的 5nm 上运行设备,例如 iPhone 12,我们将在今年秋天看到.

<块引用>

因此,Apple 软件工程师为了提供强大的 AR 体验而牺牲了应用功能.

附言

将 ARCore 与 ARKit 进行比较是不正确的,因为这些框架在内部的工作方式不同,即使它们具有相似的基本原理——例如 World Tracking场景理解渲染阶段.并且除了上述之外,我应该说 ARCore 比 ARKit 具有更温和的功能,这使得 ARCore 更加轻量级".用于 CPU 计算(虽然我理解最后一句话听起来很主观).

Out of the box it's pretty clear ARKit doesn't allow for the tracking of more than 4 images at once. (You can "track" more markers than that but only 4 will function at a time). See this question for more details on that.

However, I'm wondering if there is a possible work-around. Something like adding and removing anchors on a timer or getting the position information and then displaying the corresponding models without ARKit, etc. My knowledge of Swift is fairly limited so I haven't had much luck experimenting yet. Any suggestions or pointers in the right direction would be helpful.

By comparison ARCore for Android has a limit of 20 according to the documentation. I've also personally tested web based libraries tracking over 4 markers on an iPhone. I also believe I read somewhere that some variation of the Nintendo DS was able to track more than 4 markers. There is no way this isn't feasible because of hardware limitations.

解决方案

ARKit 5.0

Today's answer is YES, you can. Apple has told that developers can now detect up to 100 images at a time in ARKit 5.0 announced at WWDC 2021. Let's check this out.

ARKit 4.0

There's no workaround in ARKit 4.0 to simultaneously track more than FOUR images using ARImageAnchor subclass inside session's ARImageTrackingConfiguration(). I should say that this limitation works despite the fact that the total number of tracked images in a scene can be up to 100 in ARKit 4.0.

You can read comments in ARConfiguration class if you choose Jump to Definition option.

I believe this feature was limited by Cupertino software engineers not occasionally. ARImageAnchor subclass inherits from ARAnchor parent class and conforms to ARTrackable protocol, so it tracks not only static images but moving images as well (like a logo on a car's body). Hence, if you track more than 4 images – it's highly CPU/GPU intensive (the most notorious thing for draining phone's battery), cause your device must detect and track several different objects.

I suppose it will be possible to simultaneously track more than 4 images with a newer ARKit 4.0 version that can be run on considerably powerful 5nm devices, like iPhone 12, that we'll see this fall.

Thus, Apple software engineers sacrificed apps functionality for the sake of a robust AR experience.

P.S.

It is incorrect to compare ARCore with ARKit, 'cause these frameworks work differently inside, even though they have similar fundamental principles – like World Tracking, Scene Understanding and Rendering stages. And in addition to the above, I should say that ARCore has more modest functionality than ARKit, which makes ARCore more "lightweight" for CPU calculations (although I understand that the last phrase sounds very subjective).

这篇关于我可以使用 ARKit 一次跟踪 4 张以上的图像吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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