Kinect 原始深度到距离(以米为单位)
我正在尝试将 Kinect 深度图转换为以米为单位的距离。问题在于,对于深度图值“1080”及其附近,距离太大,因为分母中的项变得非常接近“0”。对于“1090”以上的值,距离为负值。
if (depthValue < 2047)
{
depthM = 1.0 / (depthValue*-0.0030711016 + 3.3309495161);
}
I am trying to convert Kinect depth map to distance in meters. The problem is that for depthmap value '1080' and around it, distance is too large because the term in denominator becomes very close to '0'. and for values above '1090', distance is negative.
if (depthValue < 2047)
{
depthM = 1.0 / (depthValue*-0.0030711016 + 3.3309495161);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正确的答案实际上是对你的问题的评论。给出的数字实际上是以毫米为单位的距离。要获得此数字,您需要使用骨架关节并调用 DepthImageFrame 的 MapFromSkeletonPoint 或将原始短值右移 DepthImageFrame.PlayerIndexBitmaskWidth。
骷髅
例如 shift
下面的原始解决方案不再正确:
基于本文的内容 - http: //openkinect.org/wiki/Imaging_Information:
The correct answer is actually a comment on your question. The number given is actually a distance in millimetres. To get this number, you either need to use a skeleton joint and call DepthImageFrame's MapFromSkeletonPoint or shift the raw short value right by DepthImageFrame.PlayerIndexBitmaskWidth.
E.g. Skeleton
E.g. shift
The original solution below is no longer correct:
Based on the contents of this article - http://openkinect.org/wiki/Imaging_Information:
老不活跃的问题,但无论如何,这对我有用我有一个旧型号的kinect(1414用于XBOX360 + PC还原),最近有时间制作一些代码和测量:
我的原始数据不是16位10/11/12/13 位!!!
所以您的数据可能非常相似。测量的最小距离为
~0.95m
最大距离未知(没有足够大的区域用于测试),最小有效值为距传感器6408 ... ~0.95m
。另一个有效值是15800 ... ~2.5m
,来自用于插值的传感器朴素(线性)转换为米
当我有更多时间时,我会检查线性度并使其更精确< /p>
为此,我需要进行一些编程以实现更好的测量,并设置工作区域以实现更精确的距离测量。如果需要,更精确的常数可能会添加余弦校正。我不知道设备/驱动程序是否自己制作或不需要测量它。当我到达时会更新我的答案,但我很懒,所以可能需要一段时间......
[编辑1]进行了一些几何测量设置和代码更改
因此,这里有新的更精确的结论:
raw
数据已由驱动程序或 kinect 本身进行余弦校正,因此raw
表示距传感器的垂直距离。原始
数据与垂直距离呈线性关系(至少在 0.8 - 2.0 m 范围内),经过更精确的测量后,深度范围为<0.8 - 4.0> 。 [m]
。之前的测量不准确。raw = 0
值太接近raw >= 32768
太远/未知值甚至其他东西(还有更多可能性)old inactive question but anyway here is what worked for me I have an old model of kinect (1414 for XBOX360 + PC reduction) and recently had time to make some code and measurements:
my raw data is 16 bit not 10/11/12/13 bit !!!
so probably your data is very similar. Min distance measured is
~0.95m
max distance unknown (have not big enough area for testing) and min valid value is6408 ... ~0.95m
from sensor . Another valid value is15800 ... ~2.5m
from sensor for interpolationnaive (linear) transformation to meters
when I will have more time then I will check the linearity and make it more precise
to do that I need to make some programing for better measurement and setup working area for more precise distance measurements. More precise constants maybe add cosine correction if its needed. I do not know if device/driver make it itself or not have to measure it. When I get to it will update my answer but I am very lazy so it can be a while ...
[Edit 1] made some geometry measurement setup and code changes
so here are new more precise conclusions:
raw
data is already cosine corrected by driver or kinect itself soraw
represent perpendicular distance from sensor.raw
data is linear to perpendicular distance (at least on 0.8 - 2.0 m range) and after more precise measurement the depth range is<0.8 - 4.0> [m]
. Measurements before was inaccurate.raw = 0
is too close valueraw >= 32768
is too far / unknown value or even something else (there are more possibilities)