Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix off-by-1 error in stitcher tile counting #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stitcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -54,4 +54,4 @@ def xy(filepath):
out_img.save(opts.out_file)

if __name__ == '__main__':
main()
main()