单骨架跟踪 [英] Single skeleton tracking
问题描述
我整个夏天一直在使用OpenInI使用Kinect,但我现在只使用SDK一个月左右。我已经尝试过寻找类似这样的问题了,但是找不到我想要的答案。
Hi, I have been working with the Kinect all summer using OpenNI but I have been working with the SDK for only a month or so now. I tried looking for similar questions like this already, but couldn't quite find the answer I am looking for.
有没有办法只跟踪一个骨架而不是两个?我正在上课,如果我只能跟踪直接在kinect前面的用户而不是站在玩家周围或后面的任何人,那将是很好的。我有
的想法正在制作它所以kinect只跟踪某个x,y,z范围内的用户?但我不确定如何实现这样的事情。
Is there a way to only track one skeleton instead of two? I am making a game for class and it would be nice if I could only track the user that is directly in front of the kinect instead of any people standing around or behind the player. Ideas I have had are making it so the kinect only tracks users in a certain x, y, z range? But I am not sure how I would implement something like this.
如果有人为我提供解决方案,我可以获得算法甚至代码来做到这一点,谢谢。
If anyone has a solution for me, could I get the algorithm or even the code to do this, thanks.
我在XNA中使用C#
Mikeshiny
Mikeshiny
推荐答案
你可以做这样的事情来跟踪nui_skeletonFrameReady方法中的一个骨架
You can do something like this to track only one skeleton in your nui_skeletonFrameReady method
SkeletonFrame allSkeletons = e.SkeletonFrame;
SkeletonData skeleton = allSkeletons.Skeletons.FirstOrDefault(s => s.TrackingState == SkeletonTrackingState.Tracked);
if (skeleton != null)
{
//TODO
}
这篇关于单骨架跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!