关于MapSkeletonPointToDepthPoint API [英] About the MapSkeletonPointToDepthPoint API
问题描述
我正面临一个让我烦恼的奇怪问题。
我尝试使用 MapSkeletonPointToDepthPoint函数来获取指定关节的深度。
以下是我的测试代码的一部分。
它位于&_bspns_AllFramesReady事件处理程序中,以确保我得到了相同帧的骨架和深度。
foreach(skeletonData中的骨架骨架)
{
if(skeleton.TrackingState == SkeletonTrackingState.Tracked)
{
SkeletonPoint skeHipCenter = skeleton.Joints [JointType.HipCenter] .Position;
DepthImagePoint hipCenter = this._sensor.CoordinateMapper.MapSkeletonPointToDepthPoint(skeHipCenter,DepthImageFormat.Resolution640x480Fps30);
int index = hipCenter.X + hipCenter.Y * 640;
+ hipCenter.X.ToString()+" ," + hipCenter.Y.ToString()+")");
Console.WriteLine(" Origin =" + _depthPixels [index] .Depth.ToString());
Console.WriteLine(" Mapped =" + hipCenter.Depth.ToString());
}
}
但是,我发现MapSkeletonPointToDepthPoint函数的深度与深度不匹配在深度框架中从深度框架复制。
我用Kinect Studio的深度查看器检查,我发现从x,y坐标映射的深度与深度查看器的深度匹配。 / p>
那么,有什么不对吗?例如,我误解了MapSkeletonPointToDepthPoint函数的用法。
感谢您耐心阅读此问题:)
深度值减去多少?您是否也比较了相邻的像素?请记住,骨架深度代表特定关节计算的身体区域。映射到深度时,通常需要分析关节周围的区域。
联合位置可能不一定是一个像素值。
Hi, I'm facing a weird problem that annoying me a lot.
I try to use the MapSkeletonPointToDepthPoint function to get the depth of specified joint.
The following is part of my code for test.
It's in the _sensor_AllFramesReady event handler to make sure that I get the skeleton and depth at the same frame.
foreach (Skeleton skeleton in skeletonData) { if (skeleton.TrackingState == SkeletonTrackingState.Tracked) { SkeletonPoint skeHipCenter = skeleton.Joints[JointType.HipCenter].Position; DepthImagePoint hipCenter = this._sensor.CoordinateMapper.MapSkeletonPointToDepthPoint(skeHipCenter, DepthImageFormat.Resolution640x480Fps30); int index = hipCenter.X + hipCenter.Y * 640; + hipCenter.X.ToString() + " , " + hipCenter.Y.ToString() + ")"); Console.WriteLine("Origin = " + _depthPixels[index].Depth.ToString()); Console.WriteLine("Mapped = " + hipCenter.Depth.ToString()); } }
However, I found that the depth from the MapSkeletonPointToDepthPoint function doesn't match with depth in the depth array copy from the depth frame.
And I checked with the depthviewer of Kinect Studio, I found that the depth mapped from the x, y coordinate is just matched with the depth of depthviewer.
So, is there something wrong? For example, I misunderstood the usage of MapSkeletonPointToDepthPoint function.
Thank you for your patience to read this question : )
How much is the depth value off by? Have you compare adjacent pixels as well? Keep in mind the skeletal depth represents an area of the body for a particular joint calculation. When mapped to depth, you typically want to analyze the area around the joint. A joint position may not necessarily be one pixel value.
这篇关于关于MapSkeletonPointToDepthPoint API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!