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

How to pass detection meta-information through the tracker? #24

Open
cansik opened this issue Jan 24, 2022 · 3 comments
Open

How to pass detection meta-information through the tracker? #24

cansik opened this issue Jan 24, 2022 · 3 comments

Comments

@cansik
Copy link

cansik commented Jan 24, 2022

As already slightly discussed in #9, it can be necessary to pass information of the detection through the tracker, to be used in a later step. For example, I have more information per detection, which is not relevant for the tracker, but for my later pipeline.

In most of the examples, the detection and active-tracks are not "related" to each other and just drawn onto the image. But I have the case where I would like to know, which detection object has become which tracked-object. Is there a way to determine this?

@wmuron
Copy link
Owner

wmuron commented Jan 28, 2022

@cansik If you need to know which detections (from current frame) were matched with which single object trackers, you can look at matches here: https://github.com/wmuron/motpy/blob/master/motpy/tracker.py#L399 - just make them accessible as a class member or just return both active tracks and matches.

If you want the property you have in mind to be a part of a Track (kind of a "state"), you need to modify the Track, Tracker and Detection classes to contain such information; also it'll require you to provide the logic of how to apply the "update" step.

Anyway, both approaches require doing small modifications by you in the motpy library.

@cansik
Copy link
Author

cansik commented Jan 29, 2022

@wmuron Thank you, would you be open for a PR if I am going to add this functionality in a way that the current API is still valid? Or would I have to publish my own package to be used in my projects?

@cansik
Copy link
Author

cansik commented Feb 12, 2022

I tried to implement it with a public matches attribute, but this is not working because the tracker list is changed after the matching, so the indexes are wrong.

It was necessary to add a reference field to the trackers and the track output to being able to later match input detections to trackers.

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

No branches or pull requests

2 participants