update calibration behavior and docs

This commit is contained in:
Josh Hawkins 2023-10-03 13:34:37 -05:00
parent aa2f86a461
commit 9c822a0b5a
2 changed files with 8 additions and 3 deletions

View File

@ -91,9 +91,11 @@ Calibration is optional, but will greatly assist Frigate in autotracking objects
To begin calibration, set the `calibrate_on_startup` for your camera to `True` and restart Frigate. Frigate will then make a series of 30 small and large movements with your camera. Don't move the PTZ manually while calibration is in progress. Once complete, camera motion will stop and your config file will be automatically updated with a `movement_weights` parameter to be used in movement calculations. You should not modify this parameter manually.
After calibration has ended, your PTZ will be moved to the preset specified by `return_preset` and you should set `calibrate_on_startup` in your config file to `False`.
After calibration has ended, your PTZ will be moved to the preset specified by `return_preset`.
Note that Frigate will refine and update the `movement_weights` parameter in your config automatically as the PTZ moves during autotracking and more measurements are obtained.
At this point, Frigate will be running and will continue to refine and update the `movement_weights` parameter in your config automatically as the PTZ moves during autotracking and more measurements are obtained.
Before restarting Frigate, you should set `calibrate_on_startup` in your config file to `False`, otherwise your refined `movement_weights` will be overwritten and calibration will occur when starting again.
You can recalibrate at any time by removing the `movement_weights` parameter, setting `calibrate_on_startup` to `True`, and then restarting Frigate. You may need to recalibrate or remove `movement_weights` from your config altogether if autotracking is erratic. If you change your `return_preset` in any way, a recalibration is also recommended.

View File

@ -239,7 +239,7 @@ class PtzAutoTracker:
# movement thread per camera
if not self.move_threads or not self.move_threads[camera]:
self.move_threads[camera] = threading.Thread(
name=f"move_thread_{camera}",
name=f"ptz_move_thread_{camera}",
target=partial(self._process_move_queue, camera),
)
self.move_threads[camera].daemon = True
@ -439,6 +439,9 @@ class PtzAutoTracker:
self.intercept[camera] is not None
and len(self.move_metrics[camera]) < 500
and (pan != 0 or tilt != 0)
and self.config.cameras[
camera
].onvif.autotracking.calibrate_on_startup
):
logger.debug(f"{camera}: Adding new values to move metrics")
self.move_metrics[camera].append(