Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

finding speed of vehicle in video

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.

  1. T= Total number of frames in the video
  2. t(enter) = the time at which one vehicle enters the scene
  3. t(leave) = the time at which the same vehicle leaves the scene
  4. T(frame) = the total time consumed by one frame
  5. T(total) = the total number of frames that were consumed by the vehicle to enter and leave the scene
  6. 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.