mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
reduce zone filter bouncing
This commit is contained in:
parent
c960914ec3
commit
4363623c45
@ -181,10 +181,12 @@ class CameraState():
|
|||||||
# check each zone
|
# check each zone
|
||||||
for name, zone in self.config['zones'].items():
|
for name, zone in self.config['zones'].items():
|
||||||
contour = zone['contour']
|
contour = zone['contour']
|
||||||
# check if the object is in the zone and not filtered
|
# check if the object is in the zone
|
||||||
if (cv2.pointPolygonTest(contour, bottom_center, False) >= 0
|
if (cv2.pointPolygonTest(contour, bottom_center, False) >= 0):
|
||||||
and not zone_filtered(obj, zone.get('filters', {}))):
|
# if the object passed the filters once, dont apply again
|
||||||
|
if name in obj.get('zones', []) or not zone_filtered(obj, zone.get('filters', {})):
|
||||||
current_zones.append(name)
|
current_zones.append(name)
|
||||||
|
|
||||||
obj['zones'] = current_zones
|
obj['zones'] = current_zones
|
||||||
|
|
||||||
# maintain best objects
|
# maintain best objects
|
||||||
|
Loading…
Reference in New Issue
Block a user