2
我正在用kinect設備開發一個手勢應用程序。在這裏,我正在用X,y,z座標檢查手勢。什麼是XYZ座標骨骼與kinect的本質是什麼
我想知道特定手勢骨架的性質。我正在檢查手勢是否推手。
private handpush()
{
bool MovedFront = false;
float refDistance = 0.2F;
SkeletonPoint refPos = SkeletonHistory[0].Joints[JointType.ShoulderCenter].Position;
SkeletonPoint startPos = SkeletonHistory[0].Joints[JointType.HandRight].Position;
//printing all intial cordinates
Console.WriteLine(" ShoulderCenter[0].Z = " + refPos.Z);
Console.WriteLine(" HandRight[0].X = " + startPos.X);
Console.WriteLine(" HandRight[0].Y = " + startPos.Y);
Console.WriteLine(" HandRight[0].Z = " + startPos.Z);
for (int i = 20; i < SkeletonHistory.Count; i++)
{
Console.WriteLine(" ShoulderCenter[i].Z = " + SkeletonHistory[i].Joints[JointType.ShoulderCenter].Position.Z);
Console.WriteLine(" HandRight[i].X = " + SkeletonHistory[i].Joints[JointType.HandRight].Position.X);
Console.WriteLine(" HandRight[i].Y = " + SkeletonHistory[i].Joints[JointType.HandRight].Position.Y);
Console.WriteLine(" HandRight[i].Z = " + SkeletonHistory[i].Joints[JointType.HandRight].Position.Z);
if (!(SkeletonHistory[i].Joints[JointType.HandRight].Position.Y < SkeletonHistory[i].Joints[JointType.Head].Position.Y &&
Math.Abs(SkeletonHistory[i].Joints[JointType.ShoulderCenter].Position.Z - refPos.Z) < 0.05F &&
Math.Abs(SkeletonHistory[i].Joints[JointType.HandRight].Position.Y - startPos.Y) < 0.1F &&
Math.Abs(SkeletonHistory[i].Joints[JointType.HandRight].Position.X - startPos.X) < 0.1F))
{
Console.WriteLine("CheckHandPush breaking !!");
break;
}
if (SkeletonHistory[i].Joints[JointType.HandRight].Position.Z <= (startPos.Z - refDistance))
{
Console.WriteLine("CheckHandPush sucess");
bMovedFront = true;
temp_SkeletonHistory.Clear();
}
}
return MovedFront;
}
但我正在逐漸INTIAL值,如:
輸出:
ShoulderCenter[0].Z = 1.246491
HandRight[0].X = 0.1519185
HandRight[0].Y = -0.2328865
HandRight[0].Z = 1.014945
ShoulderCenter[i].Z = 1.248788
HandRight[i].X = 0.1397971
HandRight[i].Y = -0.2452036
HandRight[i].Z = 1.054223
-----
ShoulderCenter[0].Z = 1.26865
HandRight[0].X = 0.1545139
HandRight[0].Y = -0.3375102
HandRight[0].Z = 1.057466
ShoulderCenter[i].Z = 1.25049
HandRight[i].X = 0.09602752
HandRight[i].Y = -0.283217
HandRight[i].Z = 1.150237
---
ShoulderCenter[0].Z = 1.243356
HandRight[0].X = 0.1406149
HandRight[0].Y = -0.2458241
HandRight[0].Z = 1.065399
ShoulderCenter[i].Z = 1.250542
HandRight[i].X = 0.1392216
HandRight[i].Y = -0.2418006
HandRight[i].Z = 1.046706
我推着我的手,讓Z軸應增加值或減少值?是指Z座標長度是從運動裝置還是人體開始的?
手推是否適合這種情況?有什麼建議麼 ?我可以得到一個示例代碼?
任何有用的鏈接x,y,z座標檢查手推,手拉?
我對座標檢查感到困惑。
太好了。感謝Henning。我瞭解了座標系統。現在我可以編寫手推算法 – user2986042