0
votes

I m trying to compute joint speed using the kinect. My algorythm to get the coordinates executes one time every 30 frames, thats how i did it:

This event runs everytime the kinect has a skeleton frame:

public void SensorSkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)
{
     //*default code to draw skeleton here*
     count++
     if (count == 30){
         //my code to acquire and display coordinates
         count = 0;
     }

 }

In theory, the part for coordinates acquisition should run every 1 second in real life (aproximattely), but thats not whats is happening. Its much faster then what it should be, but its NOT as fast as it runs when i dont use the if count.

The point is, id like to use this time interval between 2 joints capturing to compute speed, it would be (x1 - x2)/1 to have a m/s speed, since the coordinates are in meters.

I know this would be pretty inaccurate, but its just for testing.

I think the kinect isnt capturing in 30 frames per second, its much faster?

Is there any easier way to do this?

Oh and im using Visual C# and Kinect SDK

1
Consider computing elapsed time directly with System.Diagnostics.Stopwatch or DateTime.UtcNow.Dan Bryant

1 Answers

1
votes

Kinect capture in 40FPS (30 frames per seconds). Theoretically speed defines as a movement in a cycle so each joint in 1/30 seconds has their own position so in each 30 frames you have movement in one second. If you want to calculate it in an accurate way you must use some timer to calculate this timing for you instead of counter . If having an accurate data is not important in your project you may store all the position of the joint in a list or array and then start to calculate based on the data in your list: FYI in f=0, arr[0] has some value and in f=30, the value of the frame number 30 stored. so by calculating the distance between this two values you may find out your result. Actually I used this method to calculate the average walking speeds.