我想将Kinect 2中的运动捕捉数据存储为BVH文件。我找到了针对Kinect 1的代码,可以在此处找到。我遍历了代码,发现了一些我无法理解的东西。例如,在上述代码中,我试图理解skel
在代码中多个位置发现的Skeleton 对象究竟是什么。如果不是,是否有任何已知的应用程序可以实现预期的目标?
编辑:我试图将Skeleton skel更改为Body skel,我认为这是kinect SDK 2.0的对应对象。但是,当我尝试获取身体的位置时出现错误:
tempMotionVektor[0] = -Math.Round( skel.Position.X * 100,2);
tempMotionVektor[1] = Math.Round( skel.Position.Y * 100,2) + 120;
tempMotionVektor[2] = 300 - Math.Round( skel.Position.Z * 100,2);
调用Body skel函数Position时出现错误。如何在SDK 2.0中检索骨架的X,Y,Z?我试图将以上三行更改为:
tempMotionVektor[0] = -Math.Round(skel.Joints[0].Position.X * 100, 2);
tempMotionVektor[1] = Math.Round(skel.Joints[0].Position.Y * 100, 2) + 120;
tempMotionVektor[2] = 300 - Math.Round(skel.Joints[0].Position.Z * 100, 2);
编辑:基本上我结合bodyBasicsWPF和kinect2bvh后设法存储了一个bvh文件。但是,似乎我要存储的框架效率不高。肘部有奇怪的动作。我想了解是否必须更改文件kinectSkeletonBVH.cp中的某些内容。更具体地说,kinect 2版本的关节轴方向有什么变化。如何更改以下行:skel.BoneOrientations[JointType.ShoulderCenter].AbsoluteRotation.Quaternion;
我尝试使用更改该行skel.JointOrientations[JointType.ShoulderCenter].Orientation
。我对吗?我正在使用以下代码将关节添加到BVHBone对象:
BVHBone hipCenter = new BVHBone(null, JointType.SpineBase.ToString(), 6, TransAxis.None, true);
BVHBone hipCenter2 = new BVHBone(hipCenter, "HipCenter2", 3, TransAxis.Y, false);
BVHBone spine = new BVHBone(hipCenter2, JointType.SpineMid.ToString(), 3, TransAxis.Y, true);
BVHBone shoulderCenter = new BVHBone(spine, JointType.SpineShoulder.ToString(), 3, TransAxis.Y, true);
BVHBone collarLeft = new BVHBone(shoulderCenter, "CollarLeft", 3, TransAxis.X, false);
BVHBone shoulderLeft = new BVHBone(collarLeft, JointType.ShoulderLeft.ToString(), 3, TransAxis.X, true);
BVHBone elbowLeft = new BVHBone(shoulderLeft, JointType.ElbowLeft.ToString(), 3, TransAxis.X, true);
BVHBone wristLeft = new BVHBone(elbowLeft, JointType.WristLeft.ToString(), 3, TransAxis.X, true);
BVHBone handLeft = new BVHBone(wristLeft, JointType.HandLeft.ToString(), 0, TransAxis.X, true);
BVHBone neck = new BVHBone(shoulderCenter, "Neck", 3, TransAxis.Y, false);
BVHBone head = new BVHBone(neck, JointType.Head.ToString(), 3, TransAxis.Y, true);
BVHBone headtop = new BVHBone(head, "Headtop", 0, TransAxis.None, false);
我不明白代码内部的the axis for every Joint
计算位置。