detecting speed of car

13 次查看(过去 30 天)
nkumar
nkumar 2013-9-17
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 个评论
Walter Roberson
Walter Roberson 2013-9-17
I looked at the demo code and I do not see any speed involved in it.
nkumar
nkumar 2013-9-17
yes walter ,there is no spped calculation ,but i have to find the speed of the cars,kindly provide assistance

请先登录,再进行评论。

回答(2 个)

David Sanchez
David Sanchez 2013-9-17
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
  1 个评论
nkumar
nkumar 2013-9-17
can you tell how we can calculate the length of road plz

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2013-9-17
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 个评论
nkumar
nkumar 2013-9-18
Thanks walter but one thing i noticed is that ,when taking first 15 frame the values are more or less same,wheter the vehicle crosses the line or not,so how we can determine the vehicle had crossed the line,on which aspect we have to determine it
nkumar
nkumar 2013-9-18
for each frame i am calculating improfile at a same point,but why i get different values,
Is it possible to do it in the following way
Suppose i have drawn a white line on the image and if i take mean of that line point i get values as 255
in next frame if vechile is o that line ,will the mean values be same or different,i tried but am getting same values only 255

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by