【问题标题】:How to determine "real world" x, y coordinates from kinect depth data?如何从 kinect 深度数据中确定“真实世界”x、y 坐标?
【发布时间】:2012-06-19 20:07:47
【问题描述】:

kinect 传感器返回的深度值对应于与 xy 平面的真实世界 z 距离(以 mm 为单位)。到目前为止,我在最新的 sdk 中找不到任何返回 x 和 y 坐标类似的东西。这是在sdk中提供的吗?如果做不到这一点,那么计算 x 和 y 的好方法是什么?

【问题讨论】:

    标签: c# kinect


    【解决方案1】:

    您可以使用返回 SkeletonPoint 的 KinectSensor.MapDepthToSkeletonPoint 方法。示例代码可以是

    using (DepthImageFrame depthimageFrame = e.OpenDepthImageFrame())
            {
                if (depthimageFrame == null)
                {
                    return;
                }
    
                pixelData = new short[depthimageFrame.PixelDataLength];
    
                depthimageFrame.CopyPixelDataTo(pixelData);
    
                for (int x = 0; x < depthimageFrame.Width; x++)
                {
                    for (int y = 0; y < depthimageFrame.Height; y++)
                    {
                            SkeletonPoint p = sensor.MapDepthToSkeletonPoint(DepthImageFormat.Resolution640x480Fps30, x, y, pixelData[x + depthimageFrame.Width * y]);                        
                    }
                }
    
            }
    

    【讨论】:

      猜你喜欢
      • 2012-02-06
      • 2012-07-31
      • 2016-02-06
      • 2017-01-16
      • 2014-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-18
      相关资源
      最近更新 更多