Chapter 24: Detecting Images & 3D Objects

前言

之前的章節有做過辨識某個特定的2D圖片後,呈現相關AR內容。在新的ARKit 2.0中新增可辨識特定的3D物件另外可以對某個2D圖片進行追蹤。

大綱

Image Tracking

  • Image detection和Image tracking的不同

    • Image detection is a static process that locates the reference image in the real world through the device’s camera.

    • Image tracking, on the other hand, is a dynamic process that begins immediately after an image is detected. It tracks the location of the reference image if it change

  • ARKit 2.0 提供新的 configuration - ARImageTrackingConfiguration.

    • 相比ARWorldTrackingConfiguration最大的優勢less expensive in terms of processing power — CPUs and batteries。

Detecting a card

這節內容之前章節已經有做過了。偵測提供的內建的特殊圖片。

Highlighting a card

  • 再偵測到撲克牌上覆蓋一個AR紅色透明平面。

A word on tracking configuration

  • New tracking configuration ARImageTrackingConfiguration. This is specifically designed to detect and track 2D images without the burden of tracking a full 3D world.

    • It uses less CPU

    • It does it better: In world tracking, injected content is still tracked and displayed even if the detected image is no longer visible in the camera — you experienced that a few moments ago.

    • It’s more precise

    • It works in moving environments

Tracking a card, version 2.0

  • 切換成新的configuration

Creating a reference model

就像2D要提供reference image, 3D就要提供reference object, 那要如何建立reference object,Apple在WWDC 2018有提供一個範例可以讓我們產生想要的reference object。ARKit Scannerarrow-up-right

Preparing the ARKit session

Last updated