Kinect depth conversion from mm to pixels

孤人 提交于 2020-01-03 05:16:14

问题


Does anybody knows how many pixels correspond for each millimeter of depth value in images taken from kinect for xbox360? I'm using the standard resolution and settings...

Thanks!


回答1:


1 pixel corresponds to a number of millimiters that depends on the depth value of that pixels (i.e. its level of gray).

The simplest way you can get the distance between two pixels in a depth image is to convert those pixels (which are expressed in Depth Space) in real world coordinates (i.e. in Skeleton Space)1. Then, you can calculate the distance between those points using a common euclidean distance formula.

So if you have two pixels P1 and P2, with depth values respectively equal to D1 and D2, you can proceed as follows:

DepthImagePoint dip1 = new DepthImagePoint();
dip1.X = P1.x;
dip1.Y = P1.y;
dip1.Depth = D1;
DepthImagePoint dip2 = new DepthImagePoint();
dip2.X = P2.x;
dip2.Y = P2.y;
dip2.Depth = D2;
SkeletonPoint sp1 = CoordinateMapper.MapDepthPointToSkeletonPoint(DepthImageFormat.Resolution640x480Fps30, dip1);
SkeletonPoint sp2 = CoordinateMapper.MapDepthPointToSkeletonPoint(DepthImageFormat.Resolution640x480Fps30, dip2);

double dist = euclideanDistance(sp1, sp2);


1 See Coordinate Spaces for more information.

来源:https://stackoverflow.com/questions/35752364/kinect-depth-conversion-from-mm-to-pixels

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!