how to count all vehicles in matlab

3 次查看(过去 30 天)
i already have vehicle count in each frame but i need to count all the vehicles in the video ,please this is for final project any help is greatfully appreciated
  1 个评论
Ameni chetouane
Ameni chetouane 2019-7-9
i have the same problem,could you please tell me how did you fix the error?

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2018-3-13
For each vehicle, you need to use tracking to determine whether the blob is new to that frame, or existed in a prior frame. If it's new, increment your total car count.
  2 个评论
Mrityunjay Jha
Mrityunjay Jha 2020-5-3
@Image Analyst I understood your point but I am finding difficulty in implementing this. Can you please elaborate on this?
Image Analyst
Image Analyst 2020-5-3
I'm no expert on tracking and I can't write such a complicated app for you (it's far from trivial) , but I imagine you'd have an N-by-3 table where each particle is one row.
  1. The first column is it's current x location (or array of all x locations since you first found that particle/car/blob).
  2. The second column is it's current y location (or array of all y locations since you first found that particle).
  3. The third column is whether that particle is currently in the frame.
The row in the table is essentially the ID number of the particle. So for every particle in frame n you need to compute the distance, using sqrt(), of the particle to every other particle in the prior (n-1) frame, and find the closest distance. If that distance is less than what you'd expect the particle to move, then you can assume that is the same particle and update it's location (x,y). If no other particle is close enough, then you might assume that that is a new particle that has just entered the field of view and create a new row in the table for it. If there is a particle in frame (n-1) where there is no other particle close to it in the current frame, then you can assume it's left the field of view and update the third column to "false". It gets much, much more complicated than that. You might want to just see if you can buy tracking software to save you a lot of time and get something more accurate than a home-built solution.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Automated Driving Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by