Is it possible to track objects in ARKit like in Vuforia?

后端 未结 3 1832
情歌与酒
情歌与酒 2021-01-31 20:44

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

3条回答
  •  北海茫月
    2021-01-31 21:23

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

    • 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.

    • 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.

    See the WWDC18 talk on ARKit 2 for details.


    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.

    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.


    Otherwise...

    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.

提交回复
热议问题