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 中使用以下方法的应用仍会使用之前的深度范围,但我们建议您在代码库中更新这些方法,以便获得更好的功能。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eARCore's depth range has been increased from 8.191 meters to 65.535 meters in SDK version 1.31 and higher.\u003c/p\u003e\n"],["\u003cp\u003eThese changes affect apps compiled with ARCore SDK 1.31 or higher; older apps remain unaffected.\u003c/p\u003e\n"],["\u003cp\u003eDepth API now utilizes all 16 bits per pixel for depth representation, enhancing depth value accuracy.\u003c/p\u003e\n"],["\u003cp\u003eUpdated method names reflect the increased depth range and 16-bit depth representation (e.g., \u003ccode\u003eacquireDepthImage16Bits()\u003c/code\u003e replaces \u003ccode\u003eacquireDepthImage()\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eAR Foundation handles these changes automatically for Unity projects using ARCore Extensions version 1.31 or later.\u003c/p\u003e\n"]]],[],null,["# May 2022 (ARCore SDK version 1.31) changes to Depth\n\n**The changes outlined in this document are only applicable to apps compiled with ARCore SDK version 1.31 or higher. Apps compiled with an older version of ARCore will not be affected.**\n\nAs part of the May 2022 1.31 release, the maximum range of ARCore's depth has been upgraded from 8.191 meters to 65.535 meters. The [Depth API](/ar/develop/depth) now uses all 16 bits per pixel to represent depth, where previously only 13 bits were used for depth values. Though apps using the following methods in older ARCore SDKs will still work using the previous depth range, we recommend updating them in your codebase for better functionality.\n\nPlatform-specific changes\n-------------------------\n\n### Android (Kotlin/Java)\n\n| Previous method names and functionality | New method names and functionality |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Max range of 8.191 meters | Max range of 65.535 meters |\n| [Frame.acquireDepthImage()](/ar/reference/java/com/google/ar/core/Frame#acquireDepthImage-) | [Frame.acquireDepthImage16Bits()](/ar/reference/java/com/google/ar/core/Frame#acquireDepthImage16Bits-) |\n| [Frame.acquireRawDepthImage()](/ar/reference/java/com/google/ar/core/Frame#acquireRawDepthImage-) | [Frame.acquireRawDepthImage16Bits()](/ar/reference/java/com/google/ar/core/Frame#acquireRawDepthImage16Bits-) |\n| [Image.getFormat()](https://developer.android.com/reference/android/media/Image#getFormat()) returns [ImageFormat.DEPTH16](https://developer.android.com/reference/android/graphics/ImageFormat#DEPTH16) | [Image.getFormat()](https://developer.android.com/reference/android/media/Image#getFormat()) returns [HardwareBuffer.D_16](https://developer.android.com/reference/android/hardware/HardwareBuffer#D_16) |\n\n### Android NDK (C)\n\n| Previous method names and functionality | New method names and functionality |\n|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| Max range of 8.191 meters | Max range of 65.535 meters |\n| [ArFrame_acquireDepthImage()](/ar/reference/c/group/ar-frame#arframe_acquiredepthimage) | [ArFrame_acquireDepthImage16Bits()](/ar/reference/c/group/ar-frame#arframe_acquiredepthimage16bits) |\n| [ArFrame_acquireRawDepthImage()](/ar/reference/c/group/ar-frame#arframe_acquirerawdepthimage) | [ArFrame_acquireRawDepthImage16Bits()](/ar/reference/c/group/ar-frame#arframe_acquirerawdepthimage16bits) |\n| [ArImage_getFormat()](/ar/reference/c/group/ar-image#arimage_getformat) returns `AR_IMAGE_FORMAT_DEPTH16` | [ArImage_getFormat()](/ar/reference/c/group/ar-image#arimage_getformat) returns `AR_IMAGE_FORMAT_D_16` |\n\n### Unity (AR Foundation)\n\nAll changes are handled by AR Foundation. When building with ARCore Extensions for AR Foundation version 1.31 or later, [`AROcclusionManager.TryAcquireEnvironmentDepthCpuImage`](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/api/UnityEngine.XR.ARFoundation.AROcclusionManager.html#UnityEngine_XR_ARFoundation_AROcclusionManager_TryAcquireEnvironmentDepthCpuImage_UnityEngine_XR_ARSubsystems_XRCpuImage__) returns images using the new maximum range of 65.535 meters."]]