diff --git a/frigate/object_processing.py b/frigate/object_processing.py index ad450a4b9..3742cb7f2 100644 --- a/frigate/object_processing.py +++ b/frigate/object_processing.py @@ -346,7 +346,7 @@ def zone_filtered(obj: TrackedObject, object_config): if obj_settings.min_ratio > obj.obj_data["ratio"]: return True - # if the object is not proportionally narrow enough + # if the object is proportionally too wide if obj_settings.max_ratio < obj.obj_data["ratio"]: return True diff --git a/frigate/video.py b/frigate/video.py index 55340d0a1..cea749ec5 100755 --- a/frigate/video.py +++ b/frigate/video.py @@ -41,6 +41,7 @@ def filtered(obj, objects_to_track, object_filters): object_score = obj[1] object_box = obj[2] object_area = obj[3] + object_ratio = obj[4] if not object_name in objects_to_track: return True @@ -62,6 +63,14 @@ def filtered(obj, objects_to_track, object_filters): if obj_settings.min_score > object_score: return True + # if the object is not proportionally wide enough + if obj_settings.min_ratio > object_ratio: + return True + + # if the object is proportionally too wide + if obj_settings.max_ratio < object_ratio: + return True + if not obj_settings.mask is None: # compute the coordinates of the object and make sure # the location isn't outside the bounds of the image (can happen from rounding)