15,668,517 members
See more: , +
Hi, I wonder how to get the real velocity of a moving person in a video?

What I have tried:

I have stabilized the video to remove the global motion of the camera, and then I have tracked the person with an object detection method, so I have the pixel coordinates of the person in each frame. From this I can get the pixel velocity and by using a reference length in the video (for which I know the real length) I can scale the velocity to get what would be the real velocity if the object is moving perpendicular to the camera.

Now the problem is that the object is most likely not moving perpendicular to the camera lens, so how can I account for the camera perspective when deciding the real velocity?
The pixel velocity that I have is only a scaled projected 2D velocity, and I am interested in the real 3D velocity.

I appreciate any help!
Posted
Updated 26-Mar-21 10:54am
Gerry Schmitz 26-Mar-21 14:47pm
Changes in an object's height imply a change in distance from the camera; the rate of change reflecting the angle from the camera.
[no name] 26-Mar-21 15:22pm
*lol*, useless! Think about: from one frame to the other the height can change different according to speed of the 'target' object movement...
Gerry Schmitz 26-Mar-21 17:42pm
Uh, you "interpolate" between frames (new word for you).
[no name] 26-Mar-21 20:09pm
and you extrapolate stupidity?
[no name] 27-Mar-21 4:26am
i agree!

## Solution 1

What the others have posted is correct. Also, you need to ensure that the camera does not change magnification (zoom) during the video.

1) Even if the person is moving perpendicular to the camera, comparing pixel changes to the size of a known object is not enough. You also need to know the distances of the person and the reference object from the camera. You can understand this easily if you imagine using the sun as the reference object. You would clearly get a ridiculous velocity if you thought the person was running the diameter of the sun in a second or two.

2) If you know the height of the person, and the size of a reference object and the distance to the reference object, you can calculate the distance to the camera from the number of vertical pixels between the top of the head and the bottom of the feet, the number of pixels for the reference object, the distance to the reference object, and the size of the reference object, but you need to smooth (take the max value during each step or some such measure) this number because running involves bending and straightening the legs.

3) You need to determine the speed perpendicular to the camera and the speed toward or away from the camera (by measuring the change in vertical pixels over time) and then add them in quadrature to get the total speed. The velocity, as a vector, involves using a cotangent to get the direction at any given moment.

Thank you!
In my case, I have a video of a skiier, where the skiier's ski board is my reference length. So my reference object is moving with the skiier, does this affect the analysis? I do not know any distance to a fixed object nor the skiier, can I still estimate the distance between the camera and the skiier? You explain this, but I don't exactly understand how to start in order to estimate the velocity perpendicular and parallell to the camera, which I need for my resulting velocity.

If I measure the change in vertical pixel length of the skiier over time, can I then estimate the distance the skiier is moving towards or away from the camera without having the original distance between the camera and the skiier?

Gerry Schmitz 29-Mar-21 14:09pm
You "calibrate" your camera to a known object and distance. You take a "known" board size and a known distance and use that as a basis for estimating unknown distances; based on the "viewed" sizes. Calibration may require a few sightings: near, middle, far. Actual readings should fall in between.

## Solution 2

The fact that the person is skiing adds additional complexity to the processing versus running as I imagined. However, it also adds an additional clue. Let me explain what I mean.

You have to know something very well in order to measure the velocity. I thought you would be able to use the height of the person, but skiers don't stand up fully while skiing. If you could rely on always being able to see an entire ski and if you knew the length of the ski, then you could use that as a reference. For example, if you know the length of the ski, you can notice when the front of the ski reaches a stationary shadow or other detail in the snow, then notice when the back of the ski reaches the same point. You know the distance (one ski length) and you know the time (based on frame rate and elapsed frames), so you know the speed. The problem is distinguishing direction and distance. The skis will take up fewer pixels when further away but will also take up fewer pixels when turned toward or away from the camera. For this, you would need to know something that doesn't change when the skier turns, like the total size of the head, maybe? Maybe that's the answer anyway. Figure out how far away the skier's head is based on total pixels in the head and speed toward and away from the camera based on the change in the number of pixels. Then get the speed across the field of view from the change in which pixels hold which objects. Try it in a controlled experiment, like with a bicyclist going at a known speed with the camera looking from different distances and angles. If you can get that right, you have a shot at your skier analysis.