Kinect - 将(x,y)像素坐标映射到“真实世界”坐标使用深度 [英] Kinect - Map (x, y) pixel coordinates to "real world" coordinates using depth

查看:1710
本文介绍了Kinect - 将(x,y)像素坐标映射到“真实世界”坐标使用深度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Kinect和OpenCV将项目坐标导出到Flash,以用于游戏和其他程序。目前,我们的设置基于颜色并将指尖输出为(x,y,z)格式的Flash,其中x和y以像素为单位,z以毫米为单位。 p

但是,我们希望将这些(x,y)坐标映射到真实世界值,例如毫米,使用Flash中的z深度值。 Kinect 3D深度是通过沿着摄像机的水平方向投影X轴获得的,Y轴是沿着摄像机的垂直方向,Z轴是从摄像机镜头直接向前的。深度值就是从任何给定物体到XY平面的垂线长度。请参阅下面的链接(从微软的网站获得)。



微软深度坐标系举例

另外,我们知道Kinect的水平视野投影在117度的角度。

使用这个信息,我想我可以将任何给定点的深度值投影到x = 0,y = 0线上,并绘制一条平行于在这一点上的XY平面,与相机的视野相交。我最终得到一个三角形,分成两半,高度为所讨论对象的深度。然后,我可以使用一个小三角解决视野的宽度。我的方程式是:

W = tan(theta / 2)* h * 2

其中:
视角宽度


  • 水平视角角度(117度) li>
  • h =深度值



  • (对不起,我不能张贴图片,我可以)

    现在解决深度值为1000毫米(1米),给出了一个值约3264毫米。

    然而,实际上在生成相机图像时,我得到了不同的值。也就是说,我在离摄像机1米远的地方放了一根米棒,发现画面的宽度最多是1.6米,而不是估计的3.264米。有什么我在这里失踪?任何帮助将不胜感激。

    解决方案

    深度流是正确的。您确实应该获得深度值,然后从Kinect传感器中,您可以轻松找到相对于Kinect的现实世界中的点。这是通过简单的三角函数完成的,但是您必须记住,深度值是从Kinect眼睛到测量点的距离,所以它是一个长方体的对角线。

    其实,按照这个链接如何从一个独特的对象使用Kinect获得真实世界坐标(x,y,z)



    重写是没有用的,正确答案。

    I'm working on a project that uses the Kinect and OpenCV to export fintertip coordinates to Flash for use in games and other programs. Currently, our setup works based on color and exports fingertip points to Flash in (x, y, z) format where x and y are in Pixels and z is in Millimeters.

    But, we want map those (x, y) coordinates to "real world" values, like Millimeters, using that z depth value from within Flash.

    As I understand, the Kinect 3D depth is obtained via projecting the X-axis along the camera's horizontal, it's Y-axis along the camera's vertical, and it's Z-axis directly forward out of the camera's lens. Depth values are then the length of the perpendicular drawn from any given object to the XY-plane. See the picture in the below link (obtained from microsoft's website).

    Microsoft Depth Coordinate System Example

    Also, we know that the Kinect's horizontal field of vision is projected in a 117 degree angle.

    Using this information, I figured I could project the depth value of any given point onto the x=0, y=0 line and draw a horizontal line parallel to the XY-plane at that point, intersecting the camera's field of vision. I end up with a triangle, split in half, with a height of the depth of an object in question. I can then solve for the width of the field of view using a little trigonometry. My equation is:

    W = tan(theta / 2) * h * 2

    Where:

    • W = Field of view Width
    • theta = Horizontal field of view Angle (117 degrees)
    • h = Depth Value

    (Sorry, I can't post a picture, I would if I could)

    Now, solving for a depth value of 1000mm (1 meter), gives a value of about 3264mm.

    However, when actually LOOKING at the camera image produced I get a different value. Namely, I placed a meter stick 1 meter away from the camera and noticed that the width of the frame was at most 1.6 meters, not the estimated 3.264 meters from calculations.

    Is there something I'm missing here? Any help would be appreciated.

    解决方案

    The depth stream is correct. You should indeed take the depth value, and then from the Kinect sensor, you can easily locate the point in the real world relative to the Kinect. This is done by simple trigonometry, however you must keep in mind that the depth value is the distance from the Kinect "eye" to the point measured, so it is a diagonal of a cuboid.

    Actually, follow this link How to get real world coordinates (x, y, z) from a distinct object using a Kinect

    It's no use rewriting, there you have the right answer.

    这篇关于Kinect - 将(x,y)像素坐标映射到“真实世界”坐标使用深度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆