make default motion a little more sensitive

This commit is contained in:
Blake Blackshear 2021-07-07 07:32:13 -05:00
parent f4aa02cc19
commit f26f7b8d3f
2 changed files with 6 additions and 4 deletions

View File

@ -16,7 +16,7 @@ motion:
# Increasing this value will make motion detection less sensitive and decreasing it will make motion detection more sensitive. # 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. # The value should be between 1 and 255.
threshold: 25 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 # Increasing this value will prevent smaller areas of motion from being detected. Decreasing will make motion detection more sensitive to smaller
# moving objects. # moving objects.
contour_area: 100 contour_area: 100
@ -29,7 +29,7 @@ motion:
# Low values will cause things like moving shadows to be detected as motion for longer. # 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/ # https://www.geeksforgeeks.org/background-subtraction-in-an-image-using-concept-of-running-average/
frame_alpha: 0.2 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. # 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. # Lower values result in less CPU, but small changes may not register as motion.
frame_height: 180 frame_height: 180

View File

@ -99,11 +99,13 @@ class RuntimeMotionConfig(MotionConfig):
frame_shape = config.get("frame_shape", (1, 1)) frame_shape = config.get("frame_shape", (1, 1))
if "frame_height" not in config: 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: if "contour_area" not in config:
frame_width = frame_shape[1] * config["frame_height"] / frame_shape[0] 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", "") mask = config.get("mask", "")
config["raw_mask"] = mask config["raw_mask"] = mask