Question

anybody who know how to calculate the speed of hand gesture from hand tracking ? (i'm using processing 1.5.1 with simpleopenNI 0.27)

Thanks for your attention

Was it helpful?

Solution

Speed is distance per unit time. Therefore, speed is:

distance_between_hand_in_consecutive_frames/(seconds_per_frame)

To find distance in 3d, use Euclidean distance with the position of the hand in consecutive frames.

EDIT: A psuedocode example.

f1 = get_current_frame_hand_coordinates()
f0 = get_previous_frame_hand_coordinates()

Then you need a function to calculate distance. Your input should be two tuples, here a and b, of size three, i.e. (x,y,z)

e_distance(a,b):
    d = square_root( (a[0]-b[0])^2 + (a[1]-b[1])^2 + (a[2]-b[2])^2 )
    return d

dist = e_distance(f0,f1)

Basically, here you just plug the tuple values into the equation. I'm not sure how your code is laid out, this is designed for a single set of tuples.

Now that you have the distance, then we just need to calculate the speed.

speed = distance/seconds_per_frame

Wikipedia says that the framerate of a Kinect is between 9 and 30 Hz. This means that your seconds_per_frame is between 1/9 and 1/30 of a second.

This will only give you the speed. Your question asks about speed (which only has magnitude), but you can also get velocity (which has both magnitude and direction) fairly easily with a little trig.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top