Kinect intrinsic parameters from field of view
Asked Answered
G

2

13

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

Goforth answered 24/7, 2013 at 11:8 Comment(1)
if you still can't find your answer, have you tried posting here? social.msdn.microsoft.com/Forums/en-US/home?category=kinectsdk they usually have some great responses there for kinect issues.Helper
P
21

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:

Diagram of cameral world coordinates

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.

Priam answered 13/8, 2013 at 2:57 Comment(7)
I see somewhere in OpenNI the focal length is defined as 525.5f by default, while f = 480 / 2 / tan(43/2.) = 609.3f. why is that?Twain
@Twain The stated FOV angles are probably wrong. See for example smeenk.com/kinect-field-of-view-comparison where the vertical FOV is given as 48.6 degrees as retrieved by the SDK for a real device. This produces a focal length of 530.Priam
I'm more confused now... the KinectSDK docs says FOV being 57 & 43: msdn.microsoft.com/en-us/library/jj131033.aspx; while your link and another bryancook.net/2014/02/… saying them being 58.5 & 45.6 / 46.6, do they mean the official M$ docs are wrong?Twain
what's more, the KinectSDK docs and bryancook.net/2014/02/… do NOT tell image and depth FOVs apart, while smeenk.com/kinect-field-of-view-comparison does, with color image FOV being 62 x 48.6, depth FOV being 58.5 x 46.6. Does this mean the latter article is more accurate (yet actually I see it wrongly said depth resolution as 320x240)?Twain
@Twain Our problem is we don't know what the FOV in the Kinect spec is actually measuring. It could be intentionally decreased from the total camera fov because the parallax depth calculation doesn't work around the edges of the camera fov.Priam
What software did you use to create this graphic?Nannette
@Nannette I think it's just the Word drawing editor, and I grabbed a screen shot.Priam
T
0

i cannot add comment since i have a too low reputation here. But I remind that the camera angle of the kinect isn't general the same like in a normal photo camera, due to the video stream format and its sensor chip. Therefore the SDK mentioning 57 degrees and 43 degrees, might refer to different degree resolution for hight and width.

it sends a bitmap of 320x240 pixels and those pixels relate to

Horizontal FOV: 58,5° (as distributed over 320 pixels horizontal)
Vertical FOV: 45,6° (as distributed over 240 pixels vertical).

Z is known your angle is known, so i supose law of sines can get you proper locations then https://en.wikipedia.org/wiki/Law_of_sines

Tuppence answered 21/1, 2016 at 15:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.