summaryrefslogtreecommitdiff
path: root/crop-equirectangular.py
diff options
context:
space:
mode:
Diffstat (limited to 'crop-equirectangular.py')
-rw-r--r--crop-equirectangular.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/crop-equirectangular.py b/crop-equirectangular.py
index d4f90f7..5927716 100644
--- a/crop-equirectangular.py
+++ b/crop-equirectangular.py
@@ -14,6 +14,7 @@ parser.add_argument('--folder', default="/media/ssd/sequences/venice_360/equi")
parser.add_argument('--label', required=True)
parser.add_argument('--vertical_offset', type=int, default=983)
parser.add_argument('--overlap', type=float, default=0.5)
+parser.add_argument('--clobber', action='store_false')
opt = parser.parse_args()
src_width = 4096
@@ -57,6 +58,8 @@ os.makedirs(path_1)
os.makedirs(path_2)
for i, fn in enumerate(glob.glob(os.path.join(opt.folder, '*.png'))):
+ if not opt.clobber and os.path.exists(path_0):
+ continue
if (i % 100) == 0:
print("{}...".format(i))
out_fn = "frame_{:05d}.png".format(i + 1)
@@ -69,3 +72,4 @@ for i, fn in enumerate(glob.glob(os.path.join(opt.folder, '*.png'))):
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))
+