本文所述的變更僅適用於使用 ARCore SDK 1.31 以上版本編譯的應用程式。使用舊版 ARCore 編譯的應用程式不會受到影響。
在 2022 年 5 月的 1.31 版中,ARCore 的深度最大範圍已從 8.191 公尺升級至 65.535 公尺。Depth API 現在會使用每個像素的所有 16 位元來表示深度,而先前只有 13 位元用於深度值。雖然在舊版 ARCore SDK 中使用下列方法的應用程式仍可使用舊深度範圍,但我們建議您在程式碼集中更新這些方法,以便享有更優異的功能。
平台專屬變更
先前的方法名稱和功能 | 新的函式名稱和功能 |
---|---|
最大範圍為 8.191 公尺 | 最大範圍為 65.535 公尺 |
Frame.acquireDepthImage() |
Frame.acquireDepthImage16Bits() |
Frame.acquireRawDepthImage() |
Frame.acquireRawDepthImage16Bits() |
Image.getFormat() 傳回 ImageFormat.DEPTH16 |
Image.getFormat() 傳回 HardwareBuffer.D_16 |
先前的方法名稱和功能 | 新的函式名稱和功能 |
---|---|
最大範圍為 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 |
所有變更都由 AR Foundation 處理。使用 AR Foundation 1.31 以上版本的 ARCore 擴充功能建構時,AROcclusionManager.TryAcquireEnvironmentDepthCpuImage
會以 65.535 公尺的全新最大範圍傳回圖片。