Kinect V2深度帧像素大小 [英] Kinect V2 Depth Frame Pixel Size

查看:839
本文介绍了Kinect V2深度帧像素大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

kinect v2提供深度框架,分辨率为512 x 424像素,fov为70.6 x 60 degrees,每度平均约7 x 7像素. [来源].

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?

推荐答案

您是否在问如何映射深度数据中的像素大小?

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

深度坐标系与它的原点和方向正交在KINECT传感器上. 基本的三角学告诉我们直角三角形的相对侧和相邻侧之间的关系为,因此在水平方向上有tan(FOV/2) = (FrameWidth/2)/depth,因此有FrameWidth = 2*depth*tan(35.3),所以有width of 1px = depth*2*tan(35.3)/512,也有height of 1px = depth*2*tan(30)/414.

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.

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;

这篇关于Kinect V2深度帧像素大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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