How to calculate vehicle speed?

  • Thread starter Thread starter ramdas
  • Start date Start date
  • Tags Tags
    Speed Vehicle
AI Thread Summary
To calculate vehicle speed using image processing, one must measure the change in position of the vehicle across video frames while accounting for the vehicle's decreasing size as it moves away. The tangential component of velocity can be derived from position changes, but the radial component requires knowledge of the vehicle's height and assumptions about the road's tilt. Without sufficient data on initial conditions or distances, accurately computing speed becomes challenging. The discussion emphasizes the need for geometric relations and trigonometric principles to derive the necessary calculations. Ultimately, understanding the relationship between pixel dimensions and actual distances is crucial for determining vehicle speed effectively.
ramdas
Messages
78
Reaction score
0
hello everyone ,i am doing my project in image processing.i am taking video of car moving on the road and taking video frames of the same.

i want to calculate speed of vehicle.using frame rate i can calculate the time elapsed by vehicle to cover some distance. but i have one difficulty, As the vehicle goes away its size goes down also we can’t use linear scale to compute the distance .for this can anybody help me for distance computation?
i am adding images ,so that u can get an idea about it..thank u
 

Attachments

  • 123.jpg
    123.jpg
    20.1 KB · Views: 618
Mathematics news on Phys.org
Can't you just use some markers? Or just go measure the distance between two landmarks that are already there?
 
sir, my project is based on image processing and i have to measure the distance traveled by vehicle by subtracting vehicle's position at frame 4 to position of the same at frame 1 from the video frames that i will capture with some time intervals(frame rate). can i use some geometrical relation or any mathematical theory to calculate the distance? thank u..
 
ramdas said:
sir, my project is based on image processing and i have to measure the distance traveled by vehicle by subtracting vehicle's position at frame 4 to position of the same at frame 1 from the video frames that i will capture with some time intervals(frame rate). can i use some geometrical relation or any mathematical theory to calculate the distance? thank u..

You can get the tangential component of the velocity by measuring the change in position of any single point in the image of the vehicle. But that won't give you the radial component, which you will have to calculate from the change in the size of the image of the vehicle. And for both calculations... Brush up on your trigonometry - you'll be needing it.
 
But that won't give you the radial component, which you will have to calculate from the change in the size of the image of the vehicle.
If the height h is known, the road is not tilted and you can make some reasonable assumption for the height of the tracked point above the road, you can calculate the radial distance (and everything else) from the tangential component.
 
mfb said:
If the height h is known, the road is not tilted and you can make some reasonable assumption for the height of the tracked point above the road, you can calculate the radial distance (and everything else) from the tangential component.

Ah - yes, you're right. Although the assumption that the road is not tilted is a fairly strong constraint on the possible motion of the vehicle, the more I think about it, the more reasonable that constraint seems, at least for a "project".
 
A tilted or even a curved road can be taken into account, if necessary. Just makes calculations a bit more complicated.
 
You don't have enough information, simply taking a picture of a moving vehicle to computer its speed. In its simplest form the vehicle is moving directly towards you, eliminating all the more complex equations.

Consider this thought experiment. You put a piece of poster board at one end of a hallway and shoot a photo of it from 10 ft away and from 20 ft away. When you check the pixel dimensions of the poster board in the images, the one 10 ft away was 969 pixels high, the one 20 ft away was 510 pixels high, a close approximation to a linear ratio of distance to height, ie, Hx/Hy = Dx/Dy; 510/969 = 10/20; .52 = .5

So then you go outside and shoot some images of your garage door… at 25 feet and 50 feet. As you might expect the ratios of height to distance are again nearly identical. And again, the height measurements are in pixels.

But it turns out this is not enough data to compute speed. You are looking for dX/dT. dT is easy. Sample every 30th frame and I get a ‘per second’ dT. But what about dX. Suppose that with dT = 1 sec, I discern that the height becomes twice as large as it was 1 second ago… but which is the correct distance… from 20 to 10 feet or from 50 to 25 feet? I can’t tell and obviously, one would have to be moving more than twice as fast as the other.

So what if the real initial height is known? My poster board is 3 feet tall. It still doesn’t work without knowing an initial distance… I need to know 3 of the 4 variables in order to solve for the fourth. But, I don’t have any practical way of measuring distance with the camera.

You have got to have two initial conditions to be able to know the final conditions in order to be able to compute dX.
 

Similar threads

Replies
3
Views
2K
Replies
102
Views
7K
Replies
16
Views
2K
Replies
6
Views
3K
Replies
49
Views
5K
Replies
5
Views
3K
Replies
4
Views
2K
Back
Top