mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix comparison of object x-coord against mask (#52)
This commit is contained in:
parent
aea4dc8724
commit
c9e9f7a735
@ -270,9 +270,9 @@ class Camera:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
# compute the coordinates of the person and make sure
|
# 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)
|
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 the person is in a masked location, continue
|
||||||
if self.mask[y_location][x_location] == [0]:
|
if self.mask[y_location][x_location] == [0]:
|
||||||
|
Loading…
Reference in New Issue
Block a user