Skip to content

How to access tracker id of objects that crossed the line zone/ objects that are inside polygon zone #1433

Answered by rolson24
abichoi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @abichoi,
Yes you can access the tracker id of the objects that crossed the line zone like this:

zone = LineZone()
for frame in frames:
  # get the detections as normal
  detections_in_zone = detections[zone.trigger(detections=detections)]
  tracker_ids_in_zone = detections_in_zone.tracker_id

This will give you the detections in that zone at that frame. If you want to keep track of all of the detections that cross a line or enter a zone, you can just make a set with all of the tracker ids that gets added to every frame.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by abichoi
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants
Converted from issue

This discussion was converted from issue #1419 on August 06, 2024 09:45.