无法将深度空间点映射到颜色空间 [英] Fail to map depth space point to color space

查看:85
本文介绍了无法将深度空间点映射到颜色空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将深度空间点映射到颜色空间。对于初始测试,我首先捕获了深度帧并将其保存为png图像。然后我在Matlab中加载了图像,选中了一个像素(列= 100,行= 200)并获得了深度值
是973.接下来,我用下面的代码将点映射到颜色空格。

I want to map a depth space point to color space. For initial testing, I first captured a depth frame and saved it as a png image. Then I loaded the image in Matlab, picked a pixel (column=100, row=200) and obtained its depth value which is 973. Next, I used following code to map the point to color space.

DepthSpacePoint dp;
dp.X = 100;
dp.Y = 200;
UINT16 depth = 973;
ColorSpacePoint cp;
pCoordinateMapper->MapDepthPointToColorSpace(dp,depth,&cp);

函数"MapDepthPointToColorSpace"无法成功运行。 "访问违规"调用该函数时发生错误。 有没有人能告诉我如何正确使用这个功能?非常感谢!

The function"MapDepthPointToColorSpace" cannot run successfully. An "Access violation" error happened when call the function.  Does anyone can tell me how to use the function correctly ? Thanks a lot !

谢谢

fangh82

推荐答案

首先,深度不是彩色图像,因此您无法将其保存为PNG,因为这会对数据添加一定程度的压缩,从而破坏它。

first, depth is not a color image so you cannot save it as a PNG since that will add some level of compression to the data and therefore corrupt it.

第二,你如何整合Matlab来使用Kinect SDK? Kinect本身不支持Matlab,所以你必须创建一个包装器或者为库提供一些介绍。 

second, how are you integrating Matlab to use the Kinect SDK? Kinect natively does not support Matlab so you will have to create a wrapper or provide some intro with the library. 

如果你使用常规的基于.Net的应用程序C#/ WPF你可以查看坐标映射基础示例,作为如何调用api的示例。除了访问冲突错误,您不能假设深度框架中的每个点都将
映射到一个颜色像素。 

If you are using a regular .Net based application C#/WPF you can have a look at the Coordinate Mapping basics sample as an example of how to call the api's. Aside from an Access Violation error, you must not assume that every point in the depth frame will map to a color pixel. 


这篇关于无法将深度空间点映射到颜色空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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