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 remove a tracked object #266

Closed
blakeblackshear opened this issue Jun 13, 2023 · 3 comments
Closed

How to remove a tracked object #266

blakeblackshear opened this issue Jun 13, 2023 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@blakeblackshear
Copy link

Describe the situation you are working on
In my implementation, I want to stop tracking an object sometimes even when it is still visible.

Describe what is it that you need help with
I want to delete a tracked object from the tracker by the track id.

@blakeblackshear blakeblackshear added the help wanted Extra attention is needed label Jun 13, 2023
@facundo-lezama
Copy link
Collaborator

Hi @blakeblackshear!

You can always access the complete list of tracked objects on tracker.tracked_objects and modify it as you need. That's not a common thing to do with Norfair, but you can do it.

To better understand your situation, what do you expect to happen after you remove the track from the tracked objects? Because you're saying that the object will still be visible, so I understand that you will be having future detections of that same object, right?

@blakeblackshear
Copy link
Author

We have a setting to disable tracking on an object after a certain number of frames where the object has been stationary. Think of a parked car. Some would rather have the same car as separate tracked objects for the time that it entered the driveway and parked from the time where it left hours later.

And yes, the parked car can and does sometimes get picked up again.

This also helps in situations where a car is driving by and something in the background gets detected as a false positive and the tracker keeps tracking the false positive indefinitely. If you never expect objects to be stationary beyond a threshold, you can end the track by assuming it's a false positive.

@facundo-lezama
Copy link
Collaborator

I believe you will have to handle those scenarios in a post-processing stage since Norfair doesn't have the option to do that. You can try using the tracked_object.estimate_velocity property to try to understand if an object is stationary or not and then use that information to filter out those tracked objects as you wish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants