本文介绍了什么不能获得骨骼关节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想更改 编码如下
I want to change the coding as follows
private void TrackClosestSkeleton()
{
if (this.kinect != null && this.kinect.SkeletonStream != null)
{
if (!this.kinect.SkeletonStream.AppChoosesSkeletons)
{
this.kinect.SkeletonStream.AppChoosesSkeletons = true; // Ensure AppChoosesSkeletons is set
}
float closestDistance = 10000f; // Start with a far enough distance
int closestID = 0;
foreach (Skeleton skeleton in this.skeletonData.Where(s => s.TrackingState != SkeletonTrackingState.NotTracked))
{
if (skeleton.Position.Z < closestDistance)
{
closestID = skeleton.TrackingId;
closestDistance = skeleton.Position.Z;
}
}
if (closestID > 0)
{
this.kinect.SkeletonStream.ChooseSkeletons(closestID); // Track this skeleton
}
}
}
我想用骨架关节找到我喜欢的骨架,但是我无法在此代码中读取骨架的任何关节。
I want to use joints of skeleton to find the skeleton which i like, but I can't read any joints of skeleton in this code.
我尝试按如下方式更改代码:
I try to change the code as follows:
foreach (Skeleton skeleton1 in this.skeletonData.Where(s => s.TrackingState != SkeletonTrackingState.NotTracked))
{
var handrightPoint = skeleton1.Joints[JointType.HandRight];
double hand_Y = handrightPoint.Position.Y;
if (hand_Y > 0.1)
{
closestID = skeleton1.TrackingId;
}
}
我无法读取骨架的任何关节数据。 :(
I can't read any joints data of skeleton. :(
任何建议都是好的。
推荐答案
您必须检查您是否正在根据骨架进行全身跟踪.TrackingSta te == SkeletonTrackingState.Tracked
You must check that your are getting full body tracking based on the skeleton.TrackingState == SkeletonTrackingState.Tracked
这篇关于什么不能获得骨骼关节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!