Ask Your Question
1

Python remove tracked objects

asked 2020-05-18 11:50:51 -0600

Dastmann99 gravatar image

updated 2020-05-19 09:44:08 -0600

Hi, How can I delete all tracked objects and track new ones in Python? My code: code I want to remove the trackers when the "r" key is pressed. Thanks

edit retag flag offensive close merge delete

Comments

any chance you're talking about opencv's tracking module?

berak gravatar imageberak ( 2020-05-18 14:30:26 -0600 )edit
1

I'm not sure what you mean. I'm using the built-in tracker csrt. When testing it I noticed it sometimes loses tracking/tracked object goes off-screen. I want to combine this with YOLO object detection to create new tracking ROI (boxes around the objects) every few seconds to update the previous ones. When I do that however they start adding up, because the old ones don't disappear. Therefore my question is if there's a way to make the current tracked objects disappear. Thanks

Dastmann99 gravatar imageDastmann99 ( 2020-05-18 16:32:34 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-05-19 02:52:56 -0600

berak gravatar image

the old ones don't disappear.

indeed. there is a clear() function, but it is not implemented consistently for all trackers.

all you can do is -- delete the old tracker, and create a new one.

edit flag offensive delete link more

Comments

I tried to implement your solution but I can't figure out how... Here's my code if it helps Code I want to remove the trackers when the "r" key is pressed. Thanks

Dastmann99 gravatar imageDastmann99 ( 2020-05-19 07:43:16 -0600 )edit
1

please edit your question and put your code there (where it should have been in the 1st place ...)

berak gravatar imageberak ( 2020-05-19 09:34:41 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-05-18 11:50:51 -0600

Seen: 1,540 times

Last updated: May 19 '20