Kinect内部参数的视野 [英] Kinect intrinsic parameters from field of view
问题描述
感谢
编辑:关于我想要做的更多信息
我有用Kinect记录的图像的数据集,我试图转换像素(x_screen,y_screen和z_world(以mm为单位))到现实世界坐标。
如果我知道相机被放置在现实世界坐标系中的点(x',y',z')处,那么足以找到真实世界坐标通过执行以下操作:
x_world =(x_screen - c_x)* z_world / f_x
y_world =(y_screen - c_y )* z_world / f_y
其中 c_x = x'
和 c_y = y'
和 f_x,f_y
是焦距?而且我怎么才能找到只是视野的知识给予焦距?
谢谢
如果您将世界原点(0,0,0)与摄像机焦点(投影中心称为它)和相等,则假定摄像机指向正z轴,那么情况在x = 0平面中看起来像这样: b
$ b
这里的坐标轴是z(水平)和y(垂直)。下标 v
用于视口或屏幕, w
用于世界。
如果我的意思是正确的,您知道 h
,屏幕高度以像素为单位。此外, zw
, yv
和 xv
。你想知道 yw
和 xw
。注意这个计算在视口的中心有(0,0)。在左上角用(0,0)适当调整通常的屏幕坐标系。应用一点触发:
tan(43/2)=(h / 2)/ f = h /(2f),所以f = h /(2 tan(43/2))
和相似的三角形
yw / zw = yv / f也xw / zw = xv / f
$ p
$ b解决:
$ p $yw = zw * yv / f和xw = zw * xv / f
请注意,假设相机的焦距等于x -方向。它不一定是。为了在 xw
中得到最好的准确性,您应该重新计算 f = w / 2 tan(57/2)
其中 w
是屏幕宽度。这是因为 f
不是真正的焦距。这只是一个不断转换。如果摄像机的像素是方形的,并且光学系统没有像差,则这两个 f
的计算结果将会得到相同的结果。
<注意:在一篇删除的(不正确的)文章中,OP似乎说,它不是zw,而是斜边的长度D:起源于(xw,yw,zw)。在这种情况下,只需注意
zw = D * f / sqrt(xv²+yv²+f²)
(假设相机像素是方形的;如果没有,则需要一些缩放比例)。他们你可以像上面那样继续。 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)?
Thanks
EDIT: some more information on what I'm trying to do
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.
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
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?
Thanks
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:
Here the axes are z (horizontal) and y (vertical). The subscript v
is for "viewport" or screen, and w
is for world.
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) )
and similar triangles
yw / zw = yv / f also xw / zw = xv / f
Solve:
yw = zw * yv / f and xw = zw * xv / 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.
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屋!