是否可以像在 Vuforia 中一样在 ARKit 中跟踪对象? [英] Is it possible to track objects in ARKit like in Vuforia?

查看:35
本文介绍了是否可以像在 Vuforia 中一样在 ARKit 中跟踪对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果 Apple 的 ARKit 像 Vuforia 一样支持 3D 对象跟踪(甚至图像跟踪),我找不到任何信息.我不想在世界任何地方放置 3D 模型.相反,我想检测特定的 3D 对象并将 AR 对象放置在该对象的前面和顶部.

I couldn't find any information if Apple's ARKit supports 3D object tracking (or even image tracking) like Vuforia does. I don't want to place a 3D model just anywhere in the world. Instead I want to detect a specific 3D object and place AR objects in front and on top of that object.

简单的例子:我想在现实世界中跟踪一辆特定的玩具车,并在 AR 场景中在它上面添加一个扰流板.

Simple example: I want to track a specific toy car in the real world and add a spoiler on top of it in the AR scene.

有人可以向我提供信息吗?

Can someone provide me information wether that is possible or not?

推荐答案

iOS 12 更新: 在ARKit 2"(iOS 12 或更高版本上的 ARKit)中...

Update for iOS 12: In "ARKit 2" (aka ARKit on iOS 12 or later)...

  • 图像检测扩展到图像跟踪,因此最多四张图像不会被检测到一次,即使它们相对于世界空间移动,它们也会每帧实时"更新.因此,您可以将可识别的 2D 图像附加到您的玩具上,并让虚拟 AR 内容跟随屏幕上的玩具.

  • Image detection is extended to image tracking, so up to four images don't just get detected once, they get updated "live" every frame even if they're moving relative to world space. So you can attach a recognizable 2D image to your toy, and have virtual AR content follow the toy around on-screen.

还有对象检测——在您的开发过程中,您可以使用一个 ARKit 应用程序来扫描真实世界的 3D 对象并生成一个参考对象"文件.然后您可以在您的应用程序中传送该文件并使用它来识别用户环境中的该对象.这可能适合您的玩具车"案例……但请注意,3D 对象识别功能是检测,而不是跟踪:ARKit 不会在玩具车移动时跟随它.

There's also object detection — in your development process you can use one ARKit app to scan a real-world 3D object and produce a "reference object" file. Then you can ship that file in your app and use it to recognize that object in the user's environment. This might fit your "toy car" case... but be aware that the 3D object recognition feature is detection, not tracking: ARKit won't follow the toy car as it moves.

有关详细信息,请参阅关于 ARKit 2 的 WWDC18 演讲.

See the WWDC18 talk on ARKit 2 for details.

iOS 11.3 更新:在ARKit 1.5"(在 iOS 11.3 或更高版本上也称为 ARKit)中,ARKit 中有一个新的图像检测功能.如果您有已知图像(如海报或扑克牌等),您可以将它包含在您的 Xcode 项目中和/或从其他地方加载它作为 ARReferenceImage 并将其放入会话配置的 detectionImages 数组.然后,当 ARKit 在用户环境中找到这些图像时,它会给你 ARImageAnchor 对象告诉您它们在哪里.

Update for iOS 11.3: In "ARKit 1.5" (aka ARKit on iOS 11.3 or later), there's a new image detection feature in ARKit. If you have a known image (like a poster or playing card or some such), you can include it in your Xcode project and/or load it from elsewhere as an ARReferenceImage and put it in your session configuration's detectionImages array. Then, when ARKit finds those images in the user environment, it gives you ARImageAnchor objects telling you where they are.

请注意,这与您在其他一些工具包中看到的基于标记的 AR"不太相似——ARKit 只找到一次参考图像,它不会告诉您它是如何随时间移动的.所以它有利于触发"AR 内容体验(比如那些你将手机对准商店里的星球大战海报然后一个角色走出它的促销活动),但不适用于虚拟角色保持依附的 AR 棋盘游戏游戏棋子.

Note that this isn't quite like the "marker-based AR" you see from some other toolkits — ARKit finds a reference image only once, it doesn't tell you how it's moving over time. So it's good for "triggering" AR content experiences (like those promos where you point your phone at a Star Wars poster in a store and a character walks out of it), but not for, say, AR board games where virtual characters stay attached to game pieces.

否则...

可以访问每个捕获的 ARFrame 中的相机图像,因此如果您有其他软件可以帮助完成此类任务,您可以将它们与 ARKit 结合使用.例如,Vision 框架(也是 iOS 11 中的新功能)为此类提供了几个构建块.任务——您可以检测条形码并找到它们的四个角,并在手动识别图像中的感兴趣区域后,跟踪其在帧之间的移动.

It is possible to access the camera image in each captured ARFrame, so if you have other software that can help with such tasks you could use them in conjunction with ARKit. For example, the Vision framework (also new in iOS 11) offers several of the building blocks for such tasks — you can detect barcodes and find their four corners, and after manually identifying a region of interest in an image, track its movement between frames.

这篇关于是否可以像在 Vuforia 中一样在 ARKit 中跟踪对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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