mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Ensure bounding box is within camera frame (#3702)
* Ensure bounding box is within camera frame * Account for 0 index
This commit is contained in:
parent
0cf759acad
commit
911d6fdfa7
@ -647,12 +647,13 @@ def process_frames(
|
|||||||
|
|
||||||
# apply non-maxima suppression to suppress weak, overlapping bounding boxes
|
# apply non-maxima suppression to suppress weak, overlapping bounding boxes
|
||||||
# o[2] is the box of the object: xmin, ymin, xmax, ymax
|
# o[2] is the box of the object: xmin, ymin, xmax, ymax
|
||||||
|
# apply max/min to ensure values do not exceed the known frame size
|
||||||
boxes = [
|
boxes = [
|
||||||
(
|
(
|
||||||
o[2][0],
|
max(o[2][0], 0),
|
||||||
o[2][1],
|
max(o[2][1], 0),
|
||||||
o[2][2] - o[2][0],
|
min(o[2][2] - o[2][0], detect_config.width - 1),
|
||||||
o[2][3] - o[2][1],
|
min(o[2][3] - o[2][1], detect_config.height - 1),
|
||||||
)
|
)
|
||||||
for o in group
|
for o in group
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user