我有一个像素在1920*1080色框,我需要知道它的位置在相机空间米。我知道我应该使用CoordinateMapper类,但是CoordinateMapper.MapColorFrameToCameraSpace
文档中的这里方法以深度框架作为输入。我很困惑:输入不应该是一个色标吗?我想要地图之间的彩色帧和相机的空间毕竟。
我觉得有些事我不知道,如果有人能说清楚的话,我很感激。谢谢!
发布于 2015-06-05 12:49:34
它不问颜色框的原因是因为它不需要它。该方法将彩色帧中的每个可能的像素映射到相应的三维坐标上。为此,它需要深度帧,这是一个包含三维深度信息的框架,它允许软件知道该2D图像的每个点在3D空间中的位置(我不知道它们是如何实现的,但我认为它可以通过光线投射完成)。如果你想一想,就没有办法从一个简单的图像(它只包含每个点的颜色信息)重建3D世界。如果有的话,根本不需要Kinect,对吧?我们可以从简单的摄像机获得深度信息:)
希望我的回答能帮助你理解,如果有些事情不清楚,请随便问。
发布于 2015-06-04 17:19:50
这与其说是回答,不如说是评论(但我没有代表发表评论):
我认为它需要深度帧而不仅仅是彩色帧的原因是相机空间是三维的,所以它不能仅仅从2D像素位置-它需要深度。
发布于 2015-06-04 17:29:33
看看这个..。这个代码是我为万圣节制作的。它展示了你在寻找什么。代码中的注释也有帮助。
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 (?,?,?)
https://stackoverflow.com/questions/30656348
复制相似问题