Head/Neck orientation without Face Recogntion API RRS feed

  • Question

  • Hello,

    is it possible to get the head or the neck orientation without using face tracking? I like to modify the RoomAlive Toolkit to enable different looking angles towards the projection screen. In its original version, projections are only possible, if the user looks in a direction parallel to the z-axis of the Kinect. The Kinect looks towards the screen and the user is recorded from its back. Hence, I can't use face tracking.

    The main thing I do is setting a virtual camera according to head position (see code). The Kinect and the renderer share the same coordinate system. The next step would be rotatating the camera according to the head or neck orientation.

    The neck oriention is completly wrong. How do I get the absolute world oriention of the neck joint? Do I have to multiply the Inverse of the joint's parent quaternions (Neck=>SpineShoulder=>SpineMid=>SpineBase)?

    Currently, I'm using this code:

    neckOrientation = body.JointOrientations[JointType.Neck].Orientation; int pitch, yaw, roll; extractRotationInDegrees(neckOrientation, out pitch, out yaw, out roll); // Here, the printed angles are completely wrong Console.WriteLine("Neck: Pitch:" + pitch + " Yaw: " + yaw + " Roll: " + roll); // View of the renderer var userView = GraphicsTransforms.LookAt(headPosition, headPosition + SharpDX.Vector3.UnitZ, SharpDX.Vector3.UnitY); // Manipulate userView in order to get a viewing angle according to head orientation around y-axis (yaw)

    float deg = yaw; userView = userView * SharpDX.Matrix.RotationY(deg / 180.0f * (float)Math.PI ); userView.Transpose(); private static void extractRotationInDegrees(Microsoft.Kinect.Vector4 rotQuaternion, out int pitch, out int yaw, out int roll) { double x = rotQuaternion.X; double y = rotQuaternion.Y; double z = rotQuaternion.Z; double w = rotQuaternion.W; // convert rotation quaternion to Euler angles in degrees double yawD, pitchD, rollD; pitchD = Math.Atan2(2 * ((y * z) + (w * x)), (w * w) - (x * x) - (y * y) + (z * z)) / Math.PI * 180.0; yawD = Math.Asin(2 * ((w * y) - (x * z))) / Math.PI * 180.0; rollD = Math.Atan2(2 * ((x * y) + (w * z)), (w * w) + (x * x) - (y * y) - (z * z)) / Math.PI * 180.0; pitch = (int)pitchD; yaw = (int)yawD; roll = (int)rollD; }

    Thanks in advance!

    Monday, January 11, 2016 10:56 PM