Ask Your Question

Random Vehicle Detection

asked 2013-02-28 01:36:09 -0600

Ashwin gravatar image

Hi all. I want to calculate the average speed of the vehicle that is crossing the camera. So for that I want to detect the time that is taken by Random vehicle to cross the camera. By using that I can calculate the speed. ( speed=distance/timetaken ). Which method should I use? Can I detect a single object randomly?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-02-28 02:24:30 -0600

Following steps should be used to detect the average speed

  1. Create a car detector using a specific technique. OpenCV supports the use of HOG models and the part based modeling by Felzenszwalb and the Felzenszwalb model for cars is available in the OpenCV data folder. Look for latentSVM detector.
  2. For each frame detect if there are cars.
  3. When car is detected apply a tracking algorithm on the detected location.
  4. Track the car over the following frames until it's position reaches the frame border or a location specified.
  5. Use the timing over this functionality to calculate the speed over the distance.
edit flag offensive delete link more


Hi steven. Thanks for your response. What if, If there is no car for specific amount of time? It should detect all the vehicles, no?

Ashwin gravatar imageAshwin ( 2013-02-28 03:19:34 -0600 )edit

If there is no car, then no detection will happen and offcourse no tracking will happen. During tracking you will also have to remove all detections happening on your tracked car, else you will see a single car as multiple detections and create a new tracker ID each frame. This you want to avoid.

Maybe just to mention, the available car model is only good at detecting cars sideways, it could get worse if the orientation is not like the trained data.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-02-28 03:26:30 -0600 )edit

Question Tools


Asked: 2013-02-28 01:36:09 -0600

Seen: 1,548 times

Last updated: Feb 28 '13