Maths expert required...

Posted by: g_attrill

Maths expert required... - 01/07/2005 08:58

Ok, I have a problem and need a simple explanation of how to calculate something.

I would like to know how to calculate the speed of a vehicle based on two frames from a video recording. You can measure the width of the vehicle in both frames, you can measure the car itself and you know the precise time between each frame, so I presume there is some way to tell how fast it was going? Assume no information is available about the properties of the lens. The distance to the object in the first frame is available, rounded to the nearest metre.

I have done a Google search but there isn't anything that somebody with basic mathematical skills could follow.

edit: Here is an example of the imagery available:
http://www.freepichosting.com/Albums/421617291/1.html
The "NR" is the field number, and it is PAL so there are 50 fields per second.

Gareth
Posted by: peter

Re: Maths expert required... - 01/07/2005 09:12

If the lens is reasonably close to planar over the area subtended by the car -- in other words, if it's not a fish-eye lens really close-up -- then the width of the car in the image is inversely proportional to the distance, i.e. width1 * distance2 = width2 * distance1.

Because you know both widths and distance1, you can determine distance2. The difference in distances, in metres, divided by the time in seconds, gives the speed.

If the lens is severely non-planar, you can always photograph yourself at various known distances and determine the exact diminution of image size as a function of distance. The factor by which image sizes change, will apply to the car as well as to you, and you can work out the distances and thus, again, the speed.

Edit: The road marking in your three example images are different, so either the camera has panned or zoomed. If it has panned, or if the images are all clipped from larger images shot at the same zoom, the analysis still applies. If the camera has zoomed, all bets are off.

Peter
Posted by: andym

Re: Maths expert required... - 01/07/2005 09:30

You building a truvelo?
Posted by: g_attrill

Re: Maths expert required... - 01/07/2005 09:47

Holy crap it works! Wow, thanks, I thought it would be trickier than that so I didn't get the calculator out.

Here are my workings and they are astonishly accurate:

Size 1 = 434px
Size 2 = 232px
Distance 1 = 80.3m

Therefore (434* 80.3m) / 232 = 150.2m (the far distance)
Subtract 80.3m then divide by 4.06 seconds = 17.2m/s = 38.52mph

Given rough measurements and the fact that the distance could be up to four frames out, that isn't bad!

Gareth
Posted by: g_attrill

Re: Maths expert required... - 01/07/2005 09:48

Quote:
You building a truvelo?

Not likely! The frames are from a mobile LTI 20:20 camera (manually operated). There are quite a few people being given frames like that which I can now see is actually enough to do a secondary calculation of speed and check whether the equipment was working correctly.

Gareth
Posted by: andym

Re: Maths expert required... - 01/07/2005 10:10

So it's not your Skoda caught speeding then?