Kinect v2,从色框到相机的映射space

Kinect v2, mapping from color frame to camera space

我在 1920*1080 色框中有一个像素,我需要知道它在相机中的位置 space 以米为单位。我知道我应该使用 CoordinateMapper class,但是记录在 here 中的方法 CoordinateMapper.MapColorFrameToCameraSpace 将深度帧作为输入。我很困惑:输入不应该是色框吗?毕竟我想在色框和相机之间映射space

我觉得有些事情让我难以理解,如果有人能说清楚,我将不胜感激。谢谢!

这是评论而不是答案(但我没有代表发表评论):

我认为它需要深度帧而不仅仅是彩色帧的原因是相机 space 是三维的,所以它不能仅从 2D 像素位置知道 - 它需要深度。

看看这个... 这段代码是我为万圣节制作的。它展示了(某种程度上)您正在寻找的东西。代码中的注释也有帮助。

http://github.com/IntStarFoo/KinectAStare

http://github.com/IntStarFoo/KinectAStare/blob/master/ViewModels/KinectBaseViewModel.cs

                    TrackedHead = body.Joints[JointType.Head].Position;
                    //This is an 'aproxometery'  http://trailerpark.wikia.com/wiki/Rickyisms
                    //  of the tracking direction to be applied to the eyeballs on 
                    //  the screen.
                    TrackedHeadX = (int)(TrackedHead.X * 10);
                    TrackedHeadY = (int)(TrackedHead.Y * -10);

                    // Really, one should map the CameraSpacePoint to 
                    //  the angle between the location of the eyes on 
                    //  the physical screen and the tracked point. And stuff.                        //This is the TrackedHead Position (in Meters)
                    //The origin (x=0, y=0, z=0) is located at the center of the IR sensor on Kinect
                    //X grows to the sensor’s left
                    //Y grows up (note that this direction is based on the sensor’s tilt)
                    //Z grows out in the direction the sensor is facing
                    //1 unit = 1 meter

                    //Body
                    //body.Joints[JointType.Head].Position.X;
                    //body.Joints[JointType.Head].Position.Y;
                    //body.Joints[JointType.Head].Position.Z;

                    //Kinect (0,0,0)

                    //Screen Eyes (?,?,?)

之所以不问色框,是因为不需要。此方法将彩色帧中的每个可能像素映射到其对应的 3D 坐标。为此,它需要深度帧,它包含 3D 深度信息,它允许软件知道 3D space 中 2D 图像的每个点的位置(我不知道如何他们这样做了,但我想这可以通过光线投射来完成)。如果你仔细想想,没有办法从一个简单的图像(每个点只包含颜色信息)重建 3D 世界。如果有,就根本不需要Kinect了吧?我们可以从简单的相机中获取深度信息:)

希望我的回答能帮助你理解,有什么不明白的地方欢迎追问。