From 80f6b1b625f7918dfeece2e0c95ba792e56fed32 Mon Sep 17 00:00:00 2001 From: 2ManyProjects Date: Sat, 10 Jan 2026 11:44:09 -0600 Subject: [PATCH] Magic numbers --- src/stitching_scanner.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/stitching_scanner.py b/src/stitching_scanner.py index 212f63f..08ee18c 100644 --- a/src/stitching_scanner.py +++ b/src/stitching_scanner.py @@ -165,6 +165,11 @@ class StitchingScanner: h_base, w_base = base.shape[:2] h_strip, w_strip = strip.shape[:2] + # === DEBUG MAGIC NUMBERS (append_left only) === + DEBUG_SHIFT_RIGHT = 50 # Positive = shift strip right + DEBUG_SHIFT_UP = 50 # Positive = shift strip up + # ============================================= + # Clamp y_offset y_offset = max(0, min(y_offset, h_base - h_strip)) blend_w = min(blend_width, w_strip, w_base) @@ -203,12 +208,20 @@ class StitchingScanner: if x_offset is None: x_offset = 0 + # Apply debug shifts + x_offset = x_offset + DEBUG_SHIFT_RIGHT + y_offset = y_offset - DEBUG_SHIFT_UP + + # Clamp y_offset after debug adjustment + y_offset = max(0, min(y_offset, h_base - h_strip)) + # Clamp x_offset to valid range - x_offset = 0 - min(x_offset, w_base - blend_w) + x_offset = max(0, min(x_offset, w_base - blend_w)) self.log(f"=== _blend_horizontal_at_y (append_left) ===") self.log(f" base: {w_base}x{h_base}, strip: {w_strip}x{h_strip}") self.log(f" x_offset: {x_offset}, y_offset: {y_offset}, blend_w: {blend_w}") + self.log(f" DEBUG: shift_right={DEBUG_SHIFT_RIGHT}, shift_up={DEBUG_SHIFT_UP}") # Result is same size as base (no expansion when going left) result = base.copy()