Make default motion filter use SoV
Summary
The default behaviour of the motion filter still uses the SoTV approach. As we determined that performance was better with SoV, the latter approach should be the default. It may be desirable to completely remove SoTV functions and make SoV the only approach.
Steps to reproduce
Run system with non-zero "small_threshold"
in settings.json
What is the current bug behaviour?
System applies SoTV method instead of SoV
What is the expected correct behaviour?
Out of the box use SoV
Relevant logs and/or screenshots
-/-
Possible fixes
There are two fixes:
-
[Quick & less invasive] Make
"small_threshold"
zero by default, effectively disabling the small vector thresholding -
[Preferred] Change
run_raw()
in motion.py to be something like:def run_raw(self, motion_frame: np.ndarray) -> float: x_sum = sum(sum(motion_frame['x'].astype(int))) y_sum = sum(sum(motion_frame['y'].astype(int))) x_sum = self.x_iir_filter.filter(x_sum) y_sum = self.y_iir_filter.filter(y_sum) return math.sqrt(x_sum ** 2 + y_sum ** 2)