From e183781fa562a7f49a117bb49bce28a8515b434f Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Tue, 28 Jan 2025 08:23:04 -0600 Subject: [PATCH] Fix interpolation for autotracking cameras (#16191) --- frigate/ptz/onvif.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.py index 67f60d1a8..55832dfb1 100644 --- a/frigate/ptz/onvif.py +++ b/frigate/ptz/onvif.py @@ -405,19 +405,19 @@ class OnvifController: # The onvif spec says this can report as +INF and -INF, so this may need to be modified pan = numpy.interp( pan, + [-1, 1], [ self.cams[camera_name]["relative_fov_range"]["XRange"]["Min"], self.cams[camera_name]["relative_fov_range"]["XRange"]["Max"], ], - [-1, 1], ) tilt = numpy.interp( tilt, + [-1, 1], [ self.cams[camera_name]["relative_fov_range"]["YRange"]["Min"], self.cams[camera_name]["relative_fov_range"]["YRange"]["Max"], ], - [-1, 1], ) move_request.Speed = { @@ -529,11 +529,11 @@ class OnvifController: # function takes in 0 to 1 for zoom, interpolate to the values of the camera. zoom = numpy.interp( zoom, + [0, 1], [ self.cams[camera_name]["absolute_zoom_range"]["XRange"]["Min"], self.cams[camera_name]["absolute_zoom_range"]["XRange"]["Max"], ], - [0, 1], ) move_request.Speed = {"Zoom": speed}