2022 年 5 月 (ARCore SDK 1.31 版) 的深度變更

本文所述的變更僅適用於以 ARCore SDK 1.31 以上版本編譯的應用程式。使用舊版 ARCore 編譯的應用程式不會受到影響。

在 2022 年 5 月 1.31 日推出的版本中,ARCore 的深度範圍上限已從 8.191 公尺提升至 65.535 公尺。Depth API 現在使用每像素 16 位元來代表深度,先前只有 13 位元用於深度值。雖然應用程式在舊版 ARCore SDK 中使用了下列方法,但仍會使用先前的深度範圍,但建議您在程式碼集中更新這些應用程式,以提升功能性。

平台相關異動

Android (Kotlin/Java)

舊方法名稱和功能 全新方法名稱和功能
最大範圍:8.191 公尺 最大範圍是 65.535 公尺
Frame.acquireDepthImage() Frame.acquireDepthImage16Bits()
Frame.acquireRawDepthImage() Frame.acquireRawDepthImage16Bits()
Image.getFormat() 會傳回 ImageFormat.DEPTH16 Image.getFormat() 會傳回 HardwareBuffer.D_16

Android NDK (C)

舊方法名稱和功能 全新方法名稱和功能
最大範圍:8.191 公尺 最大範圍是 65.535 公尺
ArFrame_acquireDepthImage() ArFrame_acquireDepthImage16Bits()
ArFrame_acquireRawDepthImage() ArFrame_acquireRawDepthImage16Bits()
ArImage_getFormat() 會傳回 AR_IMAGE_FORMAT_DEPTH16 ArImage_getFormat() 會傳回 AR_IMAGE_FORMAT_D_16

Unity (AR Foundation)

所有變更都是由 AR Foundation 處理。如果使用 AR Foundation for AR Foundation 1.31 以上版本的 ARCore Extensions 進行建構,AROcclusionManager.TryAcquireEnvironmentDepthCpuImage 會傳回使用新範圍上限 65.535 公尺的圖片。