Kinectv2归一化深度值

Kinectv2 normalizing depth values
2020-10-17
  •  译文(汉语)
  •  原文(英语)

我正在使用Kinect v2捕获深度帧.我在C ++中看到了Kinect SDK 1.x代码,他们使用了

BYTE depth = 255 - (BYTE)(256*realDepth/0x0fff);

我想知道,此命令的目的是什么,我是否还需要将此用于Kinect v2?如果必须使用此代码,则我的代码在C#中.在乘以此256*realDepth
错误时出现错误:运算符'*'无法应用于类型为int和的操作数unshort.

对于那些打折的人,请说明原因

解决过程1

该行代码用于规范深度值,这些深度值在C ++ API中以11位编码.使用该命令,将11位表示形式转换为8位表示形式,从而可以将深度图显示为灰度图像.

无论如何,如果您使用C#开发应用程序,则无需使用该行代码,因为API可以帮您实现.

I am using Kinect v2 to capture the depth frames. I saw Kinect SDK 1.x codes in C++, they used this

BYTE depth = 255 - (BYTE)(256*realDepth/0x0fff);

I want to know, what is the purpose of this command and do I need to use this also for Kinect v2? If I have to use this, then my code is in C#. I am getting error in multiplying this 256*realDepth
Error: Operator '*' cannot be applied to operands of type int and unshort.

For those who give downmark, please explain the reason for that

Solutions1

That line of code is used to normalize depth values, which are coded in 11 bits in the C++ API. With that command, the 11-bit representation is converted in an 8-bit one, which allows to display the depth map as a grayscale image.

Anyway, you don't need to use that line of code if you are developing your application in C#, because the API can do it for you.

转载于:https://stackoverflow.com/questions/30816760/kinectv2-normalizing-depth-values

本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文

留言回复
我们只提供高质量资源,素材,源码,坚持 下了就能用 原则,让客户花了钱觉得值
上班时间 : 周一至周五9:00-17:30 期待您的加入