Smorodov / Multitarget-tracker

Multiple Object Tracker, Based on Hungarian algorithm + Kalman filter.
Apache License 2.0
2.2k stars 652 forks source link

Detection, Tracking and ID #367

Open scianand opened 2 years ago

scianand commented 2 years ago

Dear @Nuzhny007 , @Smorodov ,

I am creating an application where I am trying to detect moving objects such as birds & flies, track them and if they are detected for more than 5 times then give them an ID. I am trying to use example 1 - MotionDetector for that. Can you give me suggestions on how to approach this problem?

Thanks,

Vimal

Nuzhny007 commented 2 years ago

Hi! Can you send me a sample video? There are many nuances: birds size, static or dynamic background, wind+three letters etc.

scianand commented 2 years ago

Hi @Nuzhny007,

Thanks for your response. The object size is around 3-4 pixels sometimes less than that. The camera will be static.

Vimal

Nuzhny007 commented 2 years ago

So, it works with latest version: https://github.com/Smorodov/Multitarget-tracker/pull/368 Make git pull and rebuild. And run: Multitargettracker.exe 159662171-6c4f290c-8b5e-43d2-af04-c76992df8bf3.mp4 -e=1 -a=0 -o=159662171_res.mp4

https://user-images.githubusercontent.com/5041357/159964512-9379eb66-6013-4131-9566-20d321922fb8.mp4

Nuzhny007 commented 2 years ago

Some notes:

scianand commented 2 years ago

Hi @Nuzhny007,

Thanks a lot for your help. Is it possible to use this functionality using Python code as my application is in Python?

Vimal

Nuzhny007 commented 2 years ago

Oh, I'll try to rescue my python integration. Do you use Windows or Linux?

scianand commented 2 years ago

Hi @Nuzhny007,

I am using Linux.

Vimal

Nuzhny007 commented 2 years ago

I'm not a big Python master: https://github.com/Smorodov/Multitarget-tracker/pull/369 But on my Ubuntu worked this example: https://github.com/Smorodov/Multitarget-tracker/blob/master/demo.py

Do not forget: git pull and cmake -DMTRACKER_PYTHON=ON

Nuzhny007 commented 2 years ago

@scianand Might I use your video as Tracker example on my Youtube channel and on main page in this repository?

scianand commented 2 years ago

@Nuzhny007 ,

Thanks for your help. Yes, you can use it in your repository. I am still not able to build the repository with Python bindings. This error is showing: mtt_issue_1

How can I solve this?

Thanks,

Vimal

Nuzhny007 commented 2 years ago

Probably fixed: https://github.com/Smorodov/Multitarget-tracker/pull/370

Yes, you can use it in your repository Thnx!

scianand commented 2 years ago

Hi @Nuzhny007,

Thanks. It is working now. There are some more problems that I am facing right now:

  1. Some of the videos I have are of 1920x1080 resolution and the object size is 1x1 pixel. I want to detect and track the objects in those videos. Would this repository be able to process videos with FHD resolution in real-time?
  2. In some of the videos I am getting lots of false positives due to clouds and the movement of trees due to the wind. Is it possible to reject these detections?

Thanks in advance.

Vimal

Nuzhny007 commented 2 years ago

Hi!

  1. Yes.
  2. May be. About trees: I think than it can add filter for trajectory (speed, direction etc) - postprocessing for tracking results. Birds fly directly with high speed. But trees stays on one place. And clouds move very slow.

I can try to add such filter for trajectories.

scianand commented 2 years ago

Thanks @Nuzhny007.

Nuzhny007 commented 2 years ago

Hi! Now I have not a final answer but you can use a very simple filter for fast objects. Each track has a velocity from Kalman filter pixels per second): https://github.com/Smorodov/Multitarget-tracker/blob/8c0193f2b5cd32a236a1e84fc8c75d140254bdd8/src/Tracker/trajectory.h#L181

So, the final result:

 auto val = sqrt(rack.m_velocity[0] * rack.m_velocity[0]) + track.m_velocity[1] * rack.m_velocity[1]));
if (val > 30) // some threshold
   // Draw track - it's probably bird

Now I think about more complex filter with trajectory least squares approximation but don't sure in result

Nuzhny007 commented 2 years ago

You can try new version: https://github.com/Smorodov/Multitarget-tracker/pull/371 If it doesn't work correctly on another videos then you can share they.

Mickeyyyang commented 2 years ago

So, it works with latest version: #368 Make git pull and rebuild. And run: Multitargettracker.exe 159662171-6c4f290c-8b5e-43d2-af04-c76992df8bf3.mp4 -e=1 -a=0 -o=159662171_res.mp4

159662171_res.mp4

Could you please share the original video of this little goal?

CloudRider-pixel commented 2 years ago

Hi @scianand ,

I would also be interested to get the video in order to validate my setup.

In advance thanks, Louis

Nuzhny007 commented 2 years ago

I have this videos but don't sure that topic starter doesn't mind

tgbaoo commented 1 year ago

Hi, Very interested on your work!, Now I have some issue with the import lib step, the pymtracking lib seems like not appear, could you checking the syntax again?

vamsi-krishna-mishran commented 2 weeks ago

I am trying to detect and track insects and birds from a moving camera that always put my object in the center of the frame. How can i do this .