Kinect红外视图是否与Kinect深度视图有偏移 [英] Does Kinect Infrared View Have an offset with the Kinect Depth View

查看:148
本文介绍了Kinect红外视图是否与Kinect深度视图有偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用红外视图和深度视图进行Kinect项目.在红外视图中,使用CVBlob库,我可以提取一些2D兴趣点.我想找到这些2D点的深度.所以我认为我可以直接使用深度视图,就像这样:

I am working on a Kinect project using the infrared view and depth view. In the infrared view, using CVBlob library, I am able to extract some 2D points of interest. I want to find the depth of these 2D points. So I thought that I can use the depth view directly, something like this:

coordinates3D[0] = coordinates2D[0];
coordinates3D[1] = coordinates2D[1];
coordinates3D[2] = (USHORT*)(LockedRect.pBits)
[(int)coordinates2D[1] * Width + (int)coordinates2D[0]] >> 3;

我认为这不是获得深度的正确公式. 我能够在深度视图中可视化2D兴趣点.如果我在红外视图中得到一个点(x,y),则在深度视图中的(x,y)处将其绘制为红色点
我注意到红点不在我期望的位置(对象上).它们的位置存在系统错误.

I don't think this is the right formula to get the depth. I am able to visualize the 2D points of interest in the depth view. If I get a point (x, y) in infrared view, then I draw it as a red point in the depth view at (x, y)
I noticed that the red points are not where I expect them to be (on an object). There is a systematic error in their locations.

我认为深度视图和红外视图具有一对一的对应关系,与彩色视图和深度视图之间的对应关系不同.
这的确是真的,还是IR和景深视图之间存在偏移?如果存在偏移,我能以某种方式获得正确的深度值吗?

I was of the opinion that the depth view and infrared views have one-to-one correspondence unlike the correspondence between the color view and depth view.
Is this indeed true or is there an offset between the IR and depth views? If there is an offset, can I somehow get the right depth value?

推荐答案

深度流和颜色流不是从同一点获取的,因此它们彼此之间并不完美对应.另外,它们的视野(FOV)也不同.

Depth and Color streams are not taken from the same point so they do not correspond to each other perfectly. Also they FOV (field of view) is different.

  1. 相机

  • 红外/深度视场58.5°x 45.6°
  • 彩色FOV 62.0°x 48.6°
  • 摄像机之间的距离25mm

我对两个流的640x480分辨率的修正

if (valid depth)
 {
 ax=(((x+10-xs2)*241)>>8)+xs2;
 ay=(((y+30-ys2)*240)>>8)+ys2;
 }

  • x,y在深度图的坐标中
  • ax,ay是彩色图像中的输出坐标
  • xs,ys = 640,480
  • xs2,ys2 = 320,240
    • x,y are in coordinates in depth image
    • ax,ay are out coordinates in color image
    • xs,ys = 640,480
    • xs2,ys2 = 320,240
    • 您可以看到我的 kinect 也有y偏移,这很奇怪(甚至比x偏移还要大).我的转换在2 m以下的范围内都能很好地工作,我没有进一步测量它,但即使在那时也应该可以

      as you can see my kinect has also y-offset which is weird (even bigger then x-offset). My conversion works well on ranges up to 2 m I did not measure it further but it should work even then

      不要忘记从深度和深度图像坐标中校正空间坐标

      pz=0.8+(float(rawdepth-6576)*0.00012115165336374002280501710376283);
      px=-sin(58.5*deg*float(x-xs2)/float(xs))*pz;
      py=+sin(45.6*deg*float(y-ys2)/float(ys))*pz;
      pz=-pz;
      

      • 其中px,py,pz是相对于 kinect
      • 的[m]空间中的点坐标

        • where px,py,pz is point coordinate in [m] in space relative to kinect
        • 我对Z方向相反的摄像头使用坐标系,因此符号的取反

          I use coordinate system for camera with opposite Z direction therefore the negation of sign

          PS.我使用的是旧型号1414,所以较新的型号可能具有不同的校准参数

          PS. I have old model 1414 so newer models have probably different calibration parameters

          这篇关于Kinect红外视图是否与Kinect深度视图有偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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