From f26f7b8d3f61edab184e9350ba7bc995fbea4595 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Wed, 7 Jul 2021 07:32:13 -0500 Subject: [PATCH] make default motion a little more sensitive --- docs/docs/configuration/advanced.md | 4 ++-- frigate/config.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/docs/configuration/advanced.md b/docs/docs/configuration/advanced.md index 1db060e36..74d8d222f 100644 --- a/docs/docs/configuration/advanced.md +++ b/docs/docs/configuration/advanced.md @@ -16,7 +16,7 @@ motion: # Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive. # The value should be between 1 and 255. threshold: 25 - # Optional: Minimum size in pixels in the resized motion image that counts as motion (default: ~0.4% of the motion frame area) + # Optional: Minimum size in pixels in the resized motion image that counts as motion (default: ~0.17% of the motion frame area) # Increasing this value will prevent smaller areas of motion from being detected. Decreasing will make motion detection more sensitive to smaller # moving objects. contour_area: 100 @@ -29,7 +29,7 @@ motion: # Low values will cause things like moving shadows to be detected as motion for longer. # https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/ frame_alpha: 0.2 - # Optional: Height of the resized motion frame (default: 1/6th of the original frame height, but no less than 120) + # Optional: Height of the resized motion frame (default: 1/6th of the original frame height, but no less than 180) # This operates as an efficient blur alternative. Higher values will result in more granular motion detection at the expense of higher CPU usage. # Lower values result in less CPU, but small changes may not register as motion. frame_height: 180 diff --git a/frigate/config.py b/frigate/config.py index 48df20ea7..7a19ae25b 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -99,11 +99,13 @@ class RuntimeMotionConfig(MotionConfig): frame_shape = config.get("frame_shape", (1, 1)) if "frame_height" not in config: - config["frame_height"] = max(frame_shape[0] // 6, 120) + config["frame_height"] = max(frame_shape[0] // 6, 180) if "contour_area" not in config: frame_width = frame_shape[1] * config["frame_height"] / frame_shape[0] - config["contour_area"] = config["frame_height"] * frame_width * 0.003912363 + config["contour_area"] = ( + config["frame_height"] * frame_width * 0.00173611111 + ) mask = config.get("mask", "") config["raw_mask"] = mask