Sfoglia il codice sorgente

make default motion a little more sensitive

Blake Blackshear 3 anni fa
parent
commit
f26f7b8d3f
2 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 2 2
      docs/docs/configuration/advanced.md
  2. 4 2
      frigate/config.py

+ 2 - 2
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

+ 4 - 2
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