Clear Filters
Clear Filters

detecting speed of car

2 views (last 30 days)
nkumar
nkumar on 17 Sep 2013
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
Walter Roberson
Walter Roberson on 17 Sep 2013
I looked at the demo code and I do not see any speed involved in it.
nkumar
nkumar on 17 Sep 2013
yes walter ,there is no spped calculation ,but i have to find the speed of the cars,kindly provide assistance

Sign in to comment.

Answers (2)

David Sanchez
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
  1 Comment
nkumar
nkumar on 17 Sep 2013
can you tell how we can calculate the length of road plz

Sign in to comment.


Walter Roberson
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
nkumar
nkumar on 18 Sep 2013
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 on 18 Sep 2013
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

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!