Update .gitignore and enhance VideoEditor with improved crop handling and logging

This commit adds a new entry to the .gitignore file to exclude log files. In the VideoEditor class, it refines the crop position adjustment logic to calculate the center of the crop rectangle before applying offsets, ensuring more accurate positioning. Additionally, it enhances logging throughout the point transformation and tracking processes, providing better insights into the state of tracking points and their visibility relative to the crop area.
This commit is contained in:
2025-09-16 20:24:20 +02:00
parent c88c2cc354
commit 70364d0458
3 changed files with 80 additions and 57 deletions

View File

@@ -137,12 +137,16 @@ class MotionTracker:
self.tracking_enabled = True
self.base_crop_rect = base_crop_rect
print(f"start_tracking: base_crop_rect={base_crop_rect}, base_zoom_center={base_zoom_center}")
# If no base_zoom_center is provided, use the center of the crop rect
if base_zoom_center is None and base_crop_rect is not None:
x, y, w, h = base_crop_rect
self.base_zoom_center = (x + w//2, y + h//2)
print(f"start_tracking: using crop center as base_zoom_center: {self.base_zoom_center}")
else:
self.base_zoom_center = base_zoom_center
print(f"start_tracking: using provided base_zoom_center: {self.base_zoom_center}")
def stop_tracking(self):
"""Stop motion tracking"""