Velocity and acceleration measurement
I am trying to find a method to calculate the velocity and acceleration of a tracked object, lets say a ball falling. I am using Processing 2 with the OpenCV library to make this program, and I know the distance from the camera to the object and it can calculate its position in every frame during the motion.
To calculate the velocity, I used this formula (all calculated in pixels): VelocityX=(PositionX - LastPositionX)/delta time
And something similar with acceleration: AccelerationX=(VelocityX - LastVelocityX)/delta time
Then, I changed delta time with frames. So now I have velocity and acceleration in Pixels per frame, but my question is how can I transform this Pixels per frame unit to mm/s for example? to more intuitive units like that.
I calculate the position in pixels too, but I make a conversion to mm after that, but I'm a little confused about how to do that for velocity and acceleration.
If you know the object size and initial velocity is zero then trajectory is a line. Without stereo system you must add some hypothesis. If your object is a ball then size for every ball position will give you a scale in pixel/m. Of course this scale will changed but i feel with a linear trajectory you will have enough parameter to have function ball(x,y,z,t)
In my experiment, I'm letting a ball fall from certain height, so the trajectory is basically a line. Let's say that my ball has 27 pixels in height, and that is equivalent to 65.32 mm. In the same way, as I have a 30 fps framerate, I can say that 1 frame is 1/30 s right?, I can use this proportion to transform the velocity from pixels / frame to mm/s?
Not exactly because distance between gravity center and optical center is not constant. After it depends of focal length. May be you can try to make a picture of 10 stattic balls on trajectory line measure ball parameter s(diameter ...) and calibrate your system like this