From c9e9f7a735da2625de998fbd43e807b1a6f1853c Mon Sep 17 00:00:00 2001 From: Alexis Birkill Date: Mon, 15 Jul 2019 04:08:39 -0700 Subject: [PATCH] Fix comparison of object x-coord against mask (#52) --- frigate/video.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/video.py b/frigate/video.py index 91963d564..5581e5e1e 100644 --- a/frigate/video.py +++ b/frigate/video.py @@ -270,9 +270,9 @@ class Camera: continue # compute the coordinates of the person and make sure - # the location isnt outide the bounds of the image (can happen from rounding) + # the location isnt outside the bounds of the image (can happen from rounding) y_location = min(int(obj['ymax']), len(self.mask)-1) - x_location = min(int((obj['xmax']-obj['xmin'])/2.0), len(self.mask[0])-1) + x_location = min(int((obj['xmax']-obj['xmin'])/2.0)+obj['xmin'], len(self.mask[0])-1) # if the person is in a masked location, continue if self.mask[y_location][x_location] == [0]: @@ -311,4 +311,4 @@ class Camera: - \ No newline at end of file +