detecting speed of car
12 views (last 30 days)
Show older comments
I got some codes for tracking a car from
in this i have to find the speed of car,i dont have any idea on this ,kindly can anyone tell how to start finding spped of the car
2 Comments
Answers (2)
David Sanchez
on 17 Sep 2013
You have to know the length of the road, then, measure the time taken by the car to go along that stretch of road.
velocity = length/time
Walter Roberson
on 17 Sep 2013
Go there and use a tape measure, or lay down a long piece of string and later measure the length of the string, or use an ultrasonic range finder, or use a surveyor's transit. Or zoom in on it in Google Maps and tell that program to tell you the distance.
If you need to be able to do this for arbitrary scenes, then do you know the camera lens and specifications? With that you could calculate depth of field, and then do a fitting of the crispness on the image in order to estimate the corresponding pixel distance in the image; as you would then be able to calculate pixel to real-world correspondence, you could measure the pixel length of the road, and use the calculated correspondence to calculate the real-world road length.
If you need to work with arbitrary scenes without lens information, then you will need to go through several images until you can find a car or truck shown whose real-world length you can look up in the manufacturer's specifications. Real world information plus pixel distance allows you to calculate the ratio of pixel to real world, and then to measure the pixel length of the road and convert that to real-world distance.
But still the demo has absolutely no reference to speed, so it is not clear why you would care. The demo is only for counting cars.
11 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!