From ceedfae993b62d3244926a359c596c500e679521 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sun, 8 Dec 2019 07:16:30 -0600 Subject: [PATCH] add max person area --- config/config.example.yml | 3 +++ frigate/video.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/config/config.example.yml b/config/config.example.yml index ccfa247ee..ed16b53f7 100644 --- a/config/config.example.yml +++ b/config/config.example.yml @@ -65,14 +65,17 @@ cameras: x_offset: 0 y_offset: 300 min_person_area: 5000 + max_person_area: 100000 threshold: 0.5 - size: 400 x_offset: 350 y_offset: 250 min_person_area: 2000 + max_person_area: 100000 threshold: 0.5 - size: 400 x_offset: 750 y_offset: 250 min_person_area: 2000 + max_person_area: 100000 threshold: 0.5 diff --git a/frigate/video.py b/frigate/video.py index 9f4afd615..f53851ed0 100644 --- a/frigate/video.py +++ b/frigate/video.py @@ -286,6 +286,11 @@ class Camera: # detected person, don't add it to detected objects if region and 'min_person_area' in region and region['min_person_area'] > obj['area']: continue + + # if the detected person is larger than the + # max person area, don't add it to detected objects + if region and 'max_person_area' in region and region['max_person_area'] < obj['area']: + continue # compute the coordinates of the person and make sure # the location isnt outside the bounds of the image (can happen from rounding)