视场中的 Kinect 内在参数 [英] Kinect intrinsic parameters from field of view

查看:25
本文介绍了视场中的 Kinect 内在参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft 声明 Kinect 的视场角为垂直 43 度和水平 57 度(在 此处声明) .鉴于这些,我们可以计算内在参数,即焦点和投影中心吗?我假设投影中心可以给定为 (0,0,0)?

Microsoft state that the field of view angles for the Kinect are 43 degrees vertical and 57 horizontal (stated here) . Given these, can we calculate the intrinsic parameters i.e. focal point and centre of projection? I assume centre of projection can be given as (0,0,0)?

谢谢

关于我正在尝试做什么的更多信息

我有一个用 Kinect 记录的图像数据集,我正在尝试将像素位置(x_screen、y_screen 和 z_world(以毫米为单位))转换为真实世界坐标.

I have a dataset of images recorded with a Kinect, I am trying to convert pixel positions (x_screen,y_screen and z_world (in mm)) to real world coordinates.

如果我知道相机放置在真实世界坐标系中的点 (x',y',z') 处,通过执行以下操作是否足以找到真实世界坐标:

If I know the camera is placed at point (x',y',z') in the real world coordinate system, is it sufficient to find the real world coordinates by doing the following:

x_world = (x_screen - c_x) * z_world / f_x
y_world = (y_screen - c_y) * z_world / f_y

其中c_x = x' and c_y = y' and f_x, f_y是焦距?以及如何在仅了解视野的情况下找到焦距?

where c_x = x' and c_y = y' and f_x, f_y is the focal length? And also how can I find the focal length given just knowledge of the field of view?

谢谢

推荐答案

如果您将世界原点 (0,0,0) 等同于相机焦点(您称之为投影中心)并且 你假设相机指向正 z 轴,那么在平面 x=0 中的情况如下所示:

If you equate the world origin (0,0,0) with the camera focus (center of projection as you call it) and you assume the camera is pointing along the positive z-axis, then the situation looks like this in the plane x=0:

这里的轴是 z(水平)和 y(垂直).下标 v 代表视口"或屏幕,w 代表世界.

Here the axes are z (horizontal) and y (vertical). The subscript v is for "viewport" or screen, and w is for world.

如果我正确理解了您的意思,您就会知道 h,即屏幕高度(以像素为单位).此外,zwyvxv.你想知道 ywxw.请注意,此计算在视口中心具有 (0,0).适当调整左上角 (0,0) 的常用屏幕坐标系.应用一点触发:

If I get your meaning correctly, you know h, the screen height in pixels. Also, zw, yv and xv. You want to know yw and xw. Note this calculation has (0,0) in the center of the viewport. Adjust appropriately for the usual screen coordinate system with (0,0) in the upper left corner. Apply a little trig:

tan(43/2) = (h/2) / f = h / (2f),  so f = h / ( 2 tan(43/2) )

和相似的三角形

yw / zw = yv / f            also              xw / zw = xv / f

解决:

yw = zw * yv / f            and                xw = zw * xv / f

请注意,这假设相机的焦距"在 x 方向上是相等的.它不一定是.为了在 xw 中获得最佳精度,您应该使用 f = w/2 tan(57/2) 重新计算,其中 w 是屏幕宽度.这是因为 f 不是真正的焦距.这只是一个转换常数.如果相机的像素是方形的并且光学没有像差,这两个 f 计算将给出相同的结果.

Note this assumes the "focal length" of the camera is equal in the x-direction. It doesn't have to be. For best accuracy in xw, you should recalculate with f = w / 2 tan(57/2) where w is the screen width. This is because f isn't a true focal length. It's just a constant of conversion. If the pixels of the camera are square and optics have no aberrations, these two f calculations will give the same result.

注意:在一篇已删除的(不正确的)文章中,OP 似乎说已知的不是 zw,而是斜边的长度 D:原点到 (xw,yw,zw).在这种情况下,只需注意 zw = D * f/sqrt(xv² + yv² + f²) (假设相机像素是正方形的;如果不是,则需要进行一些缩放).他们可以按照上述方式进行.

NB: In a deleted (improper) article the OP seemed to say that it isn't zw that's known but the length D of the hypotenuse: origin to (xw,yw,zw). In this case just note zw = D * f / sqrt(xv² + yv² + f²) (assuming camera pixels are square; some scaling is necessary if not). They you can proceed as above.

这篇关于视场中的 Kinect 内在参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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