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 基礎)

所有變更都是由 AR Foundation 處理。使用 AR Foundation 1.31 以上版本適用的 ARCore 擴充功能建構時,AROcclusionManager.TryAcquireEnvironmentDepthCpuImage 會傳回使用新的 65.535 公尺範圍的圖像。