ImageFormat.Depth16 字段
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.
Android 密集深度图像格式。
[Android.Runtime.Register("DEPTH16", ApiSince=23)]
[System.Obsolete("This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.", true)]
public const Android.Graphics.ImageFormatType Depth16 = 1144402265;
[<Android.Runtime.Register("DEPTH16", ApiSince=23)>]
[<System.Obsolete("This constant will be removed in the future version. Use Android.Graphics.ImageFormatType enum directly instead of this field.", true)>]
val mutable Depth16 : Android.Graphics.ImageFormatType
字段值
Value = 1144402265- 属性
注解
Android 密集深度图像格式。
每个像素为 16 位,表示深度相机或类似传感器的测量深度。 16 位样本由置信度值和实际范围测量组成。
置信度值是此示例的正确性估计。 它在样本的 3 个最有效位中编码,值为 0 表示 100% 置信度,1 表示 0% 置信度,2 表示 1/7 的值,3 表示 2/7 等。
例如,以下示例从DEPTH16格式 android.media.Image
的第一个像素中提取范围和置信度,并将置信度转换为介于 0 和 1.f 之间的浮点值,其中 1.f 表示最大置信度:
ShortBuffer shortDepthBuffer = img.getPlanes()[0].getBuffer().asShortBuffer();
short depthSample = shortDepthBuffer.get()
short depthRange = (short) (depthSample & 0x1FFF);
short depthConfidence = (short) ((depthSample >> 13) & 0x7);
float depthPercentage = depthConfidence == 0 ? 1.f : (depthConfidence - 1) / 7.f;
</p>
此格式假定 <ul><li>an even width</li<>li>an even height</li<>li>a horizontal stride multiple of 16 pixel</li></ul>
y_size = stride * height
由相机生成时,范围单位为毫米。
适用于 . 的 android.graphics.ImageFormat.DEPTH16
Java 文档
本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。