From 802f37fe4d273cb8065fa5069556ebb9b47c41e5 Mon Sep 17 00:00:00 2001 From: Alan McConchie Date: Sat, 2 Sep 2023 16:11:48 -0700 Subject: [PATCH] Fix off-by-1 error in stitcher tile counting --- stitcher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stitcher.py b/stitcher.py index 8b48e1b..d4a9017 100644 --- a/stitcher.py +++ b/stitcher.py @@ -37,8 +37,8 @@ def xy(filepath): x_0, y_0 = min(map(lambda x_y : x_y[0], xys)), min(map(lambda x_y: x_y[1], xys)) x_1, y_1 = max(map(lambda x_y : x_y[0], xys)), max(map(lambda x_y: x_y[1], xys)) - n_x, n_y = x_1 - x_0, y_1 - y_0 - + n_x, n_y = (x_1 + 1) - x_0, (y_1 + 1) - y_0 + out_w, out_h = n_x * tile_w, n_y * tile_h print('output image size:', out_w, out_h, 'tile size:', tile_w, tile_h) @@ -54,4 +54,4 @@ def xy(filepath): out_img.save(opts.out_file) if __name__ == '__main__': - main() \ No newline at end of file + main()