【问题标题】:What is the nature of XYZ cordinates of skeleton with kinectkinect骨骼的XYZ坐标的性质是什么
【发布时间】:2016-11-07 11:59:25
【问题描述】:

我正在开发一个带有 kinect 设备的手势应用程序。这里我用 X,y,z 坐标检查手势。

我想知道特定手势的骨架性质。我正在检查手势是否是手推。

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;
}

但我得到的初始值如下:

输出:

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坐标长度是从kinect设备还是人体开始?

这种条件适合手推吗?有什么建议 ?我可以得到一个示例代码吗??

有任何有用的链接来检查手推、手拉的 x、y、z 坐标吗?

我对坐标检查感到困惑。

【问题讨论】:

    标签: c# windows kinect kinect-sdk gesture-recognition


    【解决方案1】:

    这些值在 Kinect v2 "Camera Space" 中以米为单位(链接页面上有一张漂亮的图片):

    相机空间是指 Kinect 使用的 3D 坐标系。坐标系定义如下:

    • 原点 (x=0, y=0, z=0) 位于 Kinect 红外传感器的中心
    • X 增长到传感器的左侧
    • Y 长大(注意这个方向是基于传感器的倾斜)
    • Z 向传感器所面对的方向延伸
    • 1 个单位 = 1 米

    因此,当您站在相机前并将手推向相机时,Z 值应该会减小。
    要根据用户的位置和方向获取坐标,您必须自己旋转和平移坐标。

    【讨论】:

    • 太棒了。谢谢亨宁。我了解坐标系。现在我可以编写手推算法了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多