NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Fix autotracking absolute zoom interpolation logic (#14139)
Josh Hawkinsb9e74ee9abdb
diff --git a/frigate/ptz/onvif.py b/frigate/ptz/onvif.pyindex bbcdf51885..fd3e3c396e 100644--- a/frigate/ptz/onvif.py+++ b/frigate/ptz/onvif.py@@ -406,19 +406,19 @@ class OnvifController:# The onvif spec says this can report as +INF and -INF, so this may need to be modifiedpan = 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 = {@@ -531,11 +531,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}@@ -686,11 +686,11 @@ class OnvifController:# store absolute zoom level as 0 to 1 interpolated from the values of the cameraself.ptz_metrics[camera_name].zoom_level.value = numpy.interp(round(status.Position.Zoom.x, 2),- [0, 1],[self.cams[camera_name]["absolute_zoom_range"]["XRange"]["Min"],self.cams[camera_name]["absolute_zoom_range"]["XRange"]["Max"],],+ [0, 1],)logger.debug(f"{camera_name}: Camera zoom level: {self.ptz_metrics[camera_name].zoom_level.value}"