Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detection, Tracking and ID #367

Open
scianand opened this issue Mar 22, 2022 · 21 comments
Open

Detection, Tracking and ID #367

scianand opened this issue Mar 22, 2022 · 21 comments

Comments

@scianand
Copy link

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 Nuzhny007 self-assigned this Mar 22, 2022
@Nuzhny007
Copy link
Collaborator

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

@scianand
Copy link
Author

scianand commented Mar 23, 2022

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
Copy link
Collaborator

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

@scianand
Copy link
Author

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
Copy link
Collaborator

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

@scianand
Copy link
Author

Hi @Nuzhny007,

I am using Linux.

Vimal

@Nuzhny007
Copy link
Collaborator

I'm not a big Python master: #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
Copy link
Collaborator

Nuzhny007 commented Apr 7, 2022

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

@scianand
Copy link
Author

@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
Copy link
Collaborator

Nuzhny007 commented Apr 12, 2022

Probably fixed: #370

Yes, you can use it in your repository
Thnx!

@scianand
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

Thanks @Nuzhny007.

@Nuzhny007
Copy link
Collaborator

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):

cv::Vec<track_t, 2> m_velocity; // pixels/sec

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
Copy link
Collaborator

You can try new version: #371
If it doesn't work correctly on another videos then you can share they.

@Mickeyyyang
Copy link

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
Copy link

Hi @scianand ,

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

In advance thanks,
Louis

@Nuzhny007
Copy link
Collaborator

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

@tgbaoo
Copy link

tgbaoo commented Nov 9, 2023

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
Copy link

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 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants