Multitarget-tracker
Multitarget-tracker copied to clipboard
Detection, Tracking and ID
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
Hi! Can you send me a sample video? There are many nuances: birds size, static or dynamic background, wind+three letters etc.
Hi @Nuzhny007,
Thanks for your response. The object size is around 3-4 pixels sometimes less than that. The camera will be static.
Vimal
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
Some notes:
- We will detect very small objects: https://github.com/Smorodov/Multitarget-tracker/blob/master/example/examples.h#L57
- The best background subtraction algorithm - MOG: https://github.com/Smorodov/Multitarget-tracker/blob/master/example/examples.h#L62
- New Kalman settings: https://github.com/Smorodov/Multitarget-tracker/blob/master/example/examples.h#L123
- And here mnimal trajectory size: https://github.com/Smorodov/Multitarget-tracker/blob/master/example/examples.h#L200
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
Oh, I'll try to rescue my python integration. Do you use Windows or Linux?
Hi @Nuzhny007,
I am using Linux.
Vimal
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
@scianand Might I use your video as Tracker example on my Youtube channel and on main page in this repository?
@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:
How can I solve this?
Thanks,
Vimal
Probably fixed: https://github.com/Smorodov/Multitarget-tracker/pull/370
Yes, you can use it in your repository
Thnx!
Hi @Nuzhny007,
Thanks. It is working now. There are some more problems that I am facing right now:
- 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?
- 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
Hi!
- Yes.
- 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.
Thanks @Nuzhny007.
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
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.
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?
Hi @scianand ,
I would also be interested to get the video in order to validate my setup.
In advance thanks, Louis
I have this videos but don't sure that topic starter doesn't mind
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?