Magic numbers

This commit is contained in:
2ManyProjects 2026-01-10 11:44:09 -06:00
parent ac8657f2ed
commit 80f6b1b625

View file

@ -165,6 +165,11 @@ class StitchingScanner:
h_base, w_base = base.shape[:2] h_base, w_base = base.shape[:2]
h_strip, w_strip = strip.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 # Clamp y_offset
y_offset = max(0, min(y_offset, h_base - h_strip)) y_offset = max(0, min(y_offset, h_base - h_strip))
blend_w = min(blend_width, w_strip, w_base) blend_w = min(blend_width, w_strip, w_base)
@ -203,12 +208,20 @@ class StitchingScanner:
if x_offset is None: if x_offset is None:
x_offset = 0 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 # 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"=== _blend_horizontal_at_y (append_left) ===")
self.log(f" base: {w_base}x{h_base}, strip: {w_strip}x{h_strip}") 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" 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 is same size as base (no expansion when going left)
result = base.copy() result = base.copy()