0

The kinect v2 provides a depth frame with the resolution of 512 x 424 pixels with a fov of 70.6 x 60 degrees resulting in an average of about 7 x 7 pixels per degree. [Source].

However I was unable to find any kind of information about the pixel size of the depth frame, or is there any kind of method to calculate the pixel size from the given information?

zeFrenchy
  • 6,541
  • 1
  • 27
  • 36
Kev1n91
  • 3,553
  • 8
  • 46
  • 96

1 Answers1

4

Are you asking how you to map size of pixels in the depth data?

The depth coordinate system is orthogonal with it's origin and orientation at the KINECT sensor. Basic trigonometry tells us a relationship between opposite side and adjacent side in a right angle triangle is Tan A = a/b, so horizontally we have tan(FOV/2) = (FrameWidth/2)/depth, hence FrameWidth = 2*depth*tan(35.3), and so the width of 1px = depth*2*tan(35.3)/512, similarly the height of 1px = depth*2*tan(30)/414.

KINECT field of view geometry

const int FRAME_WIDTH = 512;
const int FRAME_HEIGHT = 424;
const float FOV_HORIZONTAL = 70.6 * PI / 180.0; // convert to radians
const float FOV_VERTICAL = 60.0 * PI / 180.0;   // convert to radians
const float HORIZONTAL_SCALING = 2 * std::tan(FOV_HORIZONTAL / 2.0) / (float)FRAME_WIDTH;
const float VERTICAL_SCALING = 2 * std::tan(FOV_VERTICAL / 2.0) / (float)FRAME_HEIGHT;

for each depth pixel you can compute its width and height by doing a simple scaling:

width = HORIZONTAL_SCALING * (float)depth;
height = VERTICAL_SCALING * (float)depth;
zeFrenchy
  • 6,541
  • 1
  • 27
  • 36
  • Thank you really much for your answer, can you maybe explain a little bit of your code or link to a source? – Kev1n91 Aug 11 '17 at 07:56
  • Thank you really much for the further explanation, sry for the late reply. If I understood correctly, this only works in a depth image from the Kinect, right? So if I have a depth image rendered from a Z-Buffer image, where the further a pixel is off from the center, the higher the z-value, this mechanism does not work, so firstly the pixel would have to be projected to the camera plane ? – Kev1n91 Oct 04 '17 at 11:51
  • 1
    Yes this is for the KINECT depth data which comes "pre-projected" as described in the doc page I linked. – zeFrenchy Oct 04 '17 at 11:55