mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-30 19:09:13 +01:00
check for overlapping motion boxes
This commit is contained in:
parent
eb16de7395
commit
8ab6cba521
@ -411,7 +411,6 @@ def reduce_boxes(boxes):
|
|||||||
def intersects_any(box_a, boxes):
|
def intersects_any(box_a, boxes):
|
||||||
for box in boxes:
|
for box in boxes:
|
||||||
if box_overlaps(box_a, box):
|
if box_overlaps(box_a, box):
|
||||||
continue
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -506,12 +505,18 @@ def process_frames(
|
|||||||
# get stationary object ids
|
# get stationary object ids
|
||||||
# check every Nth frame for stationary objects
|
# check every Nth frame for stationary objects
|
||||||
# disappeared objects are not stationary
|
# disappeared objects are not stationary
|
||||||
|
# also check for overlapping motion boxes
|
||||||
stationary_object_ids = [
|
stationary_object_ids = [
|
||||||
obj["id"]
|
obj["id"]
|
||||||
for obj in object_tracker.tracked_objects.values()
|
for obj in object_tracker.tracked_objects.values()
|
||||||
|
# if there hasn't been motion for 10 frames
|
||||||
if obj["motionless_count"] >= 10
|
if obj["motionless_count"] >= 10
|
||||||
|
# and it isn't due for a periodic check
|
||||||
and obj["motionless_count"] % detect_config.stationary_interval != 0
|
and obj["motionless_count"] % detect_config.stationary_interval != 0
|
||||||
|
# and it hasn't disappeared
|
||||||
and object_tracker.disappeared[obj["id"]] == 0
|
and object_tracker.disappeared[obj["id"]] == 0
|
||||||
|
# and it doesn't overlap with any current motion boxes
|
||||||
|
and not intersects_any(obj["box"], motion_boxes)
|
||||||
]
|
]
|
||||||
|
|
||||||
# get tracked object boxes that aren't stationary
|
# get tracked object boxes that aren't stationary
|
||||||
|
Loading…
Reference in New Issue
Block a user