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

Apply zone filter before inertia #6854

Merged
merged 2 commits into from Jun 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions frigate/object_processing.py
Expand Up @@ -188,15 +188,14 @@ def update(self, current_frame_time, obj_data):
zone_score = self.zone_presence.get(name, 0)
# check if the object is in the zone
if cv2.pointPolygonTest(contour, bottom_center, False) >= 0:
self.zone_presence[name] = zone_score + 1

# an object is only considered present in a zone if it has a zone inertia of 3+
if zone_score >= zone.inertia:
# if the object passed the filters once, dont apply again
if name in self.current_zones or not zone_filtered(
self, zone.filters
):
# if the object passed the filters once, dont apply again
if name in self.current_zones or not zone_filtered(self, zone.filters):
self.zone_presence[name] = zone_score + 1

# an object is only considered present in a zone if it has a zone inertia of 3+
if zone_score >= zone.inertia:
current_zones.append(name)

if name not in self.entered_zones:
self.entered_zones.append(name)
else:
Expand Down