From 4dacf02ef914bd8bb68146d684b5a63c878fea9a Mon Sep 17 00:00:00 2001 From: blakeblackshear Date: Sun, 14 Apr 2019 11:58:02 -0500 Subject: [PATCH] add the ability to mask the standing location of a person --- config/back-mask.bmp | Bin 0 -> 1843256 bytes config/config.yml | 22 +--------------------- frigate/video.py | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 config/back-mask.bmp diff --git a/config/back-mask.bmp b/config/back-mask.bmp new file mode 100644 index 0000000000000000000000000000000000000000..b64353d12fe0ebb549d977b4a114d850ad71481e GIT binary patch literal 1843256 zcmeI)&5p#laRA_nft+#)a?T;gJVB6i?s=wtMZeKz$CE}+&q!)f;$N{o8|&$oD6;A! zRb4O)|Ih#a_kaBR$LGKP>#u+Q^Yg<$e|-G?Zyz83^zpBs-#-5K*ZqI{mydt^^N$OE z{l}kw_%{Ip1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&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)u)K9$X9Gywtx2oNAZfItKR zy person_area: continue + + # compute the coordinates of the person and make sure + # the location isnt outide 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) + + # if the person is in a masked location, continue + if self.mask[y_location][x_location] == [0]: + continue self.detected_objects.append(obj)