0

I actually measured (x,y) joint position that related to a human skeleton in the sagittal plan using Kinect v2 camera. Now, I want to create the angle between Kinect v2 and skeleton direction of motion( like in this figure: http://www.mediafire.com/file/7wf8890ngnmi1d4/kinect.pdf ).

How can I measure the joint position relative to a coordinate fixed on certain join on the skeleton like SpineBase position using MATLAB??

what is the transformation required to do that?

1 Answers1

0

I have no kinect available right now, but here is the theory how I would tackle this:

First of you seem to already be able access the different joint coordinates, so you have sth like this:

if (body.IsTracked)
{
    Joint spineMid = body.Joints[JointType.SpineMid];
    float x = spineMid.Position.X;
    float y = spineMid.Position.Y;
    float z = spineMid.Position.Z;
}

This gives us a spineMid point with x,y,z. Each frame we compare that spineMid point to the spinMid point from last frame (and save it afterwards for the comparison in the next frame). Lets call these points P_new and P_old. To get the direction Vector we just subtract the two like so:

p_dir = P_new - P_old

now we have to get the angle between this direction vector and the vector "out" of the kinect which is <0,0,1> with the kinect coordinate system. But given your drawing we need to use z_dir = <0,0,-1>. By using the unit vector of p_dir, lets call it p_dir_unit, we can use the dot product to get the angle between z_dir and p_dir_unit.

theta = acos(z_dir * p_dir_unit)

If you only need the direction in the x,z plane, you can just set the y value for p_dir to 0 and get the unit vector from that vector. From the absolute length of p_dir you can also get information on how quick the body is moving.

Hope that helps.

Jodo
  • 4,515
  • 6
  • 38
  • 50