xoffset fix

This commit is contained in:
2ManyProjects 2026-01-08 22:11:07 -06:00
parent c8e6a1f506
commit 4785a99a63

View file

@ -48,6 +48,8 @@ class StitchState:
total_rows: int = 0 total_rows: int = 0
mosaic_width: int = 0 mosaic_width: int = 0
mosaic_height: int = 0 mosaic_height: int = 0
mosaic_init_width: int = 0
mosaic_init_height: int = 0
frame_count: int = 0 frame_count: int = 0
append_count: int = 0 append_count: int = 0
@ -148,6 +150,8 @@ class StitchingScanner:
h, w = frame.shape[:2] h, w = frame.shape[:2]
self.state.mosaic_width = w self.state.mosaic_width = w
self.state.mosaic_height = h self.state.mosaic_height = h
self.state.mosaic_init_width = w
self.state.mosaic_init_height = h
self.state.frame_count = 1 self.state.frame_count = 1
self.state.append_count = 0 self.state.append_count = 0
@ -205,7 +209,7 @@ class StitchingScanner:
h_strip, w_strip = strip.shape[:2] h_strip, w_strip = strip.shape[:2]
# Clamp x_offset to valid range # Clamp x_offset to valid range
x_offset = max(0, w_base - 1) x_offset = max(0, w_base - self.state.mosaic_init_width)
# Create full-width strip with strip placed at x_offset # Create full-width strip with strip placed at x_offset
full_strip = np.zeros((h_strip, w_base, 3), dtype=np.uint8) full_strip = np.zeros((h_strip, w_base, 3), dtype=np.uint8)