mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
reverse logic
This commit is contained in:
parent
c935122de0
commit
c36caa6978
@ -636,8 +636,8 @@ class PtzAutoTracker:
|
|||||||
target_box = obj.obj_data["area"] / (camera_width * camera_height)
|
target_box = obj.obj_data["area"] / (camera_width * camera_height)
|
||||||
|
|
||||||
# introduce some hysteresis to prevent a yo-yo zooming effect
|
# introduce some hysteresis to prevent a yo-yo zooming effect
|
||||||
zoom_in_hysteresis = target_box > (self.previous_target_box[camera] * 1.2)
|
zoom_out_hysteresis = target_box > (self.previous_target_box[camera] * 1.2)
|
||||||
zoom_out_hysteresis = target_box < (self.previous_target_box[camera] * 0.9)
|
zoom_in_hysteresis = target_box < (self.previous_target_box[camera] * 0.9)
|
||||||
|
|
||||||
at_max_zoom = self.ptz_metrics[camera]["ptz_zoom_level"].value == 1
|
at_max_zoom = self.ptz_metrics[camera]["ptz_zoom_level"].value == 1
|
||||||
at_min_zoom = self.ptz_metrics[camera]["ptz_zoom_level"].value == 0
|
at_min_zoom = self.ptz_metrics[camera]["ptz_zoom_level"].value == 0
|
||||||
@ -769,8 +769,6 @@ class PtzAutoTracker:
|
|||||||
# don't zoom on initial move
|
# don't zoom on initial move
|
||||||
if self.tracked_object_previous[camera] is None:
|
if self.tracked_object_previous[camera] is None:
|
||||||
zoom = current_zoom_level
|
zoom = current_zoom_level
|
||||||
# start with a slightly smaller box to encourage an initial zoom
|
|
||||||
self.previous_target_box[camera] = target_box * 0.8
|
|
||||||
else:
|
else:
|
||||||
if (
|
if (
|
||||||
result := self._should_zoom_in(camera, obj, obj.obj_data["box"])
|
result := self._should_zoom_in(camera, obj, obj.obj_data["box"])
|
||||||
@ -783,7 +781,8 @@ class PtzAutoTracker:
|
|||||||
# relative zooming concurrently with pan/tilt
|
# relative zooming concurrently with pan/tilt
|
||||||
if camera_config.onvif.autotracking.zooming == ZoomingModeEnum.relative:
|
if camera_config.onvif.autotracking.zooming == ZoomingModeEnum.relative:
|
||||||
if self.tracked_object_previous[camera] is None:
|
if self.tracked_object_previous[camera] is None:
|
||||||
self.previous_target_box[camera] = target_box
|
# start with a slightly altered box to encourage an initial zoom
|
||||||
|
self.previous_target_box[camera] = target_box * 1.2
|
||||||
|
|
||||||
if (
|
if (
|
||||||
result := self._should_zoom_in(
|
result := self._should_zoom_in(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user