Microsoft Kinect SDK深度数据到现实世界坐标

我使用Microsoft Kinect SDK从Kinect获取深度和颜色信息,然后将该信息转换为点云.我需要深度信息是以相机中心为原点的现实世界坐标.

我看到了一些转换功能,但这显然是为OpenNI和非Microsoft驱动.我已经看到,Kinect的深度信息已经是毫米,并且包含在11bits …或某事.

如何将这个位信息转换成我可以使用的真实世界坐标?

提前致谢!

在Kinect for Windows库中使用Microsoft.Research.Kinect.Nui.SkeletonEngine类,以及以下方法来满足此要求:
public Vector DepthImagetoSkeleton (
    float depthX,float depthY,short depthValue
)

方法将基于真实世界的测量,将Kinect生成的深度图像映射为矢量可扩展的图像.

从那里(当我以前创建了一个网格),在枚举由Kinect深度图像创建的位图中的字节数组后,您将创建一个类似于以下内容的Vector列表:

var width = image.Image.Width;
        var height = image.Image.Height;
        var greyIndex = 0;

        var points = new List<Vector>();

        for (var y = 0; y < height; y++)
        {
            for (var x = 0; x < width; x++)
            {
                short depth;
                switch (image.Type)
                {
                    case ImageType.DepthAndplayerIndex:
                        depth = (short)((image.Image.Bits[greyIndex] >> 3) | (image.Image.Bits[greyIndex + 1] << 5));
                        if (depth <= maximumDepth)
                        {
                            points.Add(nui.SkeletonEngine.DepthImagetoSkeleton(((float)x / image.Image.Width),((float)y / image.Image.Height),(short)(depth << 3)));
                        }
                        break;
                    case ImageType.Depth: // depth comes back mirrored
                        depth = (short)((image.Image.Bits[greyIndex] | image.Image.Bits[greyIndex + 1] << 8));
                        if (depth <= maximumDepth)
                        {
                            points.Add(nui.SkeletonEngine.DepthImagetoSkeleton(((float)(width - x - 1) / image.Image.Width),(short)(depth << 3)));
                        }
                        break;
                }

                greyIndex += 2;
            }
        }

通过这样做,最终的结果是以毫米为单位存储的向量列表,如果你想要厘米乘以100(等等).

相关文章

Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...
Windows文件操作基础代码 Windows下对文件进行操作使用的一段...
Winpcap基础代码 使用Winpcap进行网络数据的截获和发送都需要...
使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看...