mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-29 11:26:49 +03:00
Fixes (#18220)
* Add option to not trim clip * Improve API * Update snapshot for new best objects * Fix missing strings * Convert to separate key * Always include bounding box on snapshots * improve autotracking relative zooming time calculation * update proxy docs to note the need for comma separated header roles * Add count translation * tracked object lifecycle i18n fix * update speed estimation docs * clarity * Re-initialize onvif information when toggling camera on live view * Move time ago to card info and add face area * Clarify face recognition docs * Increase minimum face recognition area * use clipFrom to in vod module endpoint to start at the correct time * Cleanup media api * Don't change duration * Use search detail dialog for face library * Move to segment based * Cleanup * Add back duration modification * clean up docs --------- Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
co-authored by
Josh Hawkins
parent
1fa7ce5486
commit
d3d05fa397
@@ -1171,7 +1171,20 @@ class PtzAutoTracker:
|
||||
zoom_predicted_movement_time = 0
|
||||
|
||||
if np.any(average_velocity):
|
||||
zoom_predicted_movement_time = abs(zoom) * self.zoom_time[camera]
|
||||
# Calculate the intended change in zoom level
|
||||
zoom_change = (1 - abs(zoom)) * (1 if zoom >= 0 else -1)
|
||||
|
||||
# Calculate new zoom level and clamp to [0, 1]
|
||||
new_zoom = max(
|
||||
0, min(1, self.ptz_metrics[camera].zoom_level.value + zoom_change)
|
||||
)
|
||||
|
||||
# Calculate the actual zoom distance
|
||||
zoom_distance = abs(
|
||||
new_zoom - self.ptz_metrics[camera].zoom_level.value
|
||||
)
|
||||
|
||||
zoom_predicted_movement_time = zoom_distance * self.zoom_time[camera]
|
||||
|
||||
zoom_predicted_box = (
|
||||
predicted_box
|
||||
@@ -1188,7 +1201,7 @@ class PtzAutoTracker:
|
||||
tilt = (0.5 - (centroid_y / camera_height)) * 2
|
||||
|
||||
logger.debug(
|
||||
f"{camera}: Zoom amount: {zoom}, zoom predicted time: {zoom_predicted_movement_time}, zoom predicted box: {tuple(zoom_predicted_box)}"
|
||||
f"{camera}: Zoom amount: {zoom}, zoom distance: {zoom_distance}, zoom predicted time: {zoom_predicted_movement_time}, zoom predicted box: {tuple(zoom_predicted_box)}"
|
||||
)
|
||||
|
||||
self._enqueue_move(camera, obj.obj_data["frame_time"], pan, tilt, zoom)
|
||||
|
||||
Reference in New Issue
Block a user