Kinect2 原始深度到以米为单位的距离

Kinect2 raw depth to distance in meters

如何将 Kinect2 原始深度数据转换为以米为单位的距离。原始深度数据由 Windows Kinect2 SDK 获取。都是积分数据。 要点:是kinect2而不是kinect1。 我已经得到了Kinect1的方程式,但它不匹配。 所以任何人都可以帮助我。 Kinect1的方程式:

if (depthValue < 2047) 
{
  depthM = 1.0 / (depthValue*-0.0030711016 + 3.3309495161);
}

Kinect API Overview (2)表示:

The DepthFrame Class represents a frame where each pixel represents the distance of the closest object seen by that pixel. The data for this frame is stored as 16-bit unsigned integers, where each value represents the distance in millimeters. The maximum depth distance is 8 meters, although reliability starts to degrade at around 4.5 meters. Developers can use the depth frame to build custom tracking algorithms in cases where the BodyFrame Class isn’t enough.

还有V. Pterneas comments in his blog that the values are in meters, he refers to this code. So you could retrieve it from the DepthFrame in C# (extracted partially from this code):

public override void Update(DepthFrame frame)
{
    ushort minDepth = frame.DepthMinReliableDistance;
    ushort maxDepth = frame.DepthMaxReliableDistance;
    //..
    Width = frame.FrameDescription.Width;
    Height = frame.FrameDescription.Height;
    public ushort[] DepthData;
    //...
    frame.CopyFrameDataToArray(DepthData);
    // now Depthdata contains the depth
}

最小和最大深度由函数 DepthMinReliableDistance and DepthMaxReliableDistance 给出,单位也是毫米。