# finding speed of vehicle in video [closed]

Can you please assist me with getting the speed of vehicles in a video. I have googled a lot on this but I could not find a solution. My task was to count cars and get the speed of every car and save to a stack/array. I have been able to count the cars but I an not sure how to calculate the speed. I had imagined I would do it in this manner.

- T= Total number of frames in the video
- t(enter) = the time at which one vehicle enters the scene
- t(leave) = the time at which the same vehicle leaves the scene
- T(frame) = the total time consumed by one frame
- T(total) = the total number of frames that were consumed by the vehicle to enter and leave the scene
- d = the total distance(in meters) of the road; the distance of the road that is on interest: the real distance.

I was then hoping that speed in KM/h may be calculated as follows speed = d/[t(left)-t(enter)]

I was then hoping to take each of the speeds and save then to a stack/array for further processing.

I am not sure if this is the correct way of processing speed from a video.

Thank you in advance.