car counting. speed calculation

8 ビュー (過去 30 日間)
ben
ben 2012 年 10 月 9 日
回答済み: David Verrelli 2016 年 10 月 21 日
hi everyone. im trying to do a project on MATLAB, something about car counting, and a rough estimate of the cars speed. for now im able to detect the cars by tagging them with a red dot. like in this http://www.mathworks.com/help/images/examples/detecting-cars-in-a-video-of-traffic.html
how do i proceed? i have a video feed of the expressway, and i am thinking of drawing two lines, an entry line and an exit line where the cards will be detected, counted, and speed measured in between the lines.
thanks in advance for your help!
  1 件のコメント
A7mad
A7mad 2013 年 7 月 3 日
編集済み: Walter Roberson 2016 年 10 月 1 日
please, can you help me if you know any code to detect speed of vehicle on MATLAB

サインインしてコメントする。

回答 (1 件)

David Verrelli
David Verrelli 2016 年 10 月 21 日
Hi, Ben, Walter & A7mad.
For me, I'd be concerned, if setting up two 'lines' at different distances along the road, about the possibility of mismatch between the entering car and the exiting car. This would not be a problem if you either uniquely identify each individual car (perhaps colour would be a simple, but not foolproof, check) or you continued to track each car between lines. Alternatively, it also wouldn't be a problem if there is very little traffic and/or there is only one lane.
Given that you would probably end up tracking, and you have perhaps used some sort of blob analysis as part of your recognition algorithm, then if the centroid of the blob is computed reliably, you can just measure pixel displacement of the centroid between frames (one or multiple frames, perhaps with averaging). Then, knowing the framerate of the video, and knowing some conversion factor between pixels and physical distance on the expressway, you can get a speed.
Depending on the camera's perspective, the scaling of cars in the distance is likely to be quite different from that for cars in the foreground. You could still implement a variable conversion factor if needed. (Variation may be negligible for the special case of an overhead view from high up.) This is where your idea of picking two 'lines' would be a little simpler in that you would be able to choose physical landmarks in the image and from those define the physical distance.
If centroid estimation was not very accurate, then you would want to average over more frames, or use some other approach such as optical flow in the region of the car.

カテゴリ

Help Center および File ExchangeAutomated Driving Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by