0

Question is, I want to calculate the speed of my arm for Slap detection. So I am using openpose to get the body points (here total points: 25) using body_25 model and using this along with the time I want to deduce the speed of my arm, i googled through openpose, stackoverflow, github.But could not succeed?

Velocity = Distance / Time = dx/dt

dx = frame3_bodypoints - frame_1_bodypoints; dt = ?

I don't know how to find this from the openpose, is there a way I can find this? Any thoughts, would be great help!

user3827728
  • 109
  • 1
  • 1
  • 9
  • What's wrong with just using the speed of the hand (point 4 or 7)? dt is the time between frames and probably doesn't even matter all that much as long as the time between frames is roughly constant. For a slap, you're looking for an abrupt change of velocity, right? – bfris Aug 26 '21 at 22:17
  • @bfris: Thanks for the reply. Do you think difference between the frames is sufficient? Yes, looking for abrupt change in velocity. – user3827728 Aug 27 '21 at 09:37

1 Answers1

0

I've never used OpenPose. But Newtonian physics would indicate that a slap corresponds to a sudden change in velocity of the hand.

I think it's a reasonable first approximation to assume that the Δt between frames is constant. Instantaneous variation in frame rate is called jitter. I would expect jitter to be small for modern recording devices. In any case, I don't know how to get instantaneous frame rate with the tools (OpenCV, PIL) that I am familiar with. I couldn't find any references to frame rate or time in the OpenPose docs.

For calculating velocity and delta-velocity, you have choices. Straight up linear velocity of the hand might be the easiest. For position changes use the geometric mean of positions (Δs = sqrt((x2-x1)^2 + (y2-y1)^2).

You could also calculate an angular velocity between the hand and the elbow, but that would be a little more involved and prone to noise.

bfris
  • 5,272
  • 1
  • 20
  • 37
  • Thanks for the reply: For linear velocity, is it like the object has to follow a specific straight line in terms of its movement? ref: https://www.vedantu.com/physics/linear-velocity – user3827728 Aug 30 '21 at 06:08
  • Maybe you don't care whether the velocity is linear or angular. Maybe just looking for a sudden change is enough to give you a slap signal. I would start with linear because it's easier to calculate. In any event, once you have a dataset, you can go nuts analyzing it different ways. – bfris Aug 30 '21 at 14:44