summaryrefslogtreecommitdiff
path: root/crop-equirectangular.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-01-08 20:54:39 +0100
committerJules Laplace <julescarbon@gmail.com>2019-01-08 20:54:39 +0100
commit608312597279f12e109adcd43068988a69606ab1 (patch)
treecba0dd77e03cfe8c6d8d4abbfe0d0b15ec72cf2e /crop-equirectangular.py
parentbd2724d99d123c2a8a5b02ed4985a9d0c3f77655 (diff)
crop-thirds
Diffstat (limited to 'crop-equirectangular.py')
-rw-r--r--crop-equirectangular.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/crop-equirectangular.py b/crop-equirectangular.py
index 38e93ae..317c34e 100644
--- a/crop-equirectangular.py
+++ b/crop-equirectangular.py
@@ -17,6 +17,8 @@ parser = argparse.ArgumentParser()
parser.add_argument('--folder', default="./sequences/venice_360/equi")
parser.add_argument('--label', required=True)
parser.add_argument('--vertical_offset', type=int, default=983)
+# parser.add_argument('--dst_width', type=int, default=1024)
+# parser.add_argument('--dst_height', type=int, default=512)
parser.add_argument('--folder_id', type=int, required=True)
parser.add_argument('--overlap', type=float, default=0.5)
parser.add_argument('--clobber', action='store_false')
@@ -25,6 +27,10 @@ opt = parser.parse_args()
src_width = 4096
src_height = 2048
+dst_width = 1024
+dst_height = 512
+dst_size = (dst_width, dst_height,)
+
count = 3
output_aspect = 3
@@ -86,9 +92,9 @@ def build_thumbnail(i, fn):
canvas.paste(image, (0, 0))
canvas.paste(image, (src_width, 0))
- canvas.crop(p0).resize((1024, 512,), Image.ANTIALIAS).save(os.path.join(path_0, out_fn))
- canvas.crop(p1).resize((1024, 512,), Image.ANTIALIAS).save(os.path.join(path_1, out_fn))
- canvas.crop(p2).resize((1024, 512,), Image.ANTIALIAS).save(os.path.join(path_2, out_fn))
+ canvas.crop(p0).resize(dst_size, Image.ANTIALIAS).save(os.path.join(path_0, out_fn))
+ canvas.crop(p1).resize(dst_size, Image.ANTIALIAS).save(os.path.join(path_1, out_fn))
+ canvas.crop(p2).resize(dst_size, Image.ANTIALIAS).save(os.path.join(path_2, out_fn))
chunksize = 3
with Pool(processes=cpu_count()) as pool: