From 641e29afcf4dc773bbed0e24f5f3b801a35fd177 Mon Sep 17 00:00:00 2001 From: Pau Gargallo Date: Thu, 22 Jun 2017 14:08:39 +0200 Subject: [PATCH] fix(undistort): make perspective views of panos the same size as the depthmaps --- opensfm/commands/undistort.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opensfm/commands/undistort.py b/opensfm/commands/undistort.py index e6666119d..b142299f7 100644 --- a/opensfm/commands/undistort.py +++ b/opensfm/commands/undistort.py @@ -50,11 +50,12 @@ def undistort_images(self, graph, reconstruction, data): urec.add_shot(shot) elif shot.camera.projection_type in ['equirectangular', 'spherical']: original = data.image_as_array(shot.id) - width = 4 * int(data.config['depthmap_resolution']) + subshot_width = int(data.config['depthmap_resolution']) + width = 4 * subshot_width height = width / 2 image = cv2.resize(original, (width, height), interpolation=cv2.INTER_AREA) - shots = perspective_views_of_a_panorama(shot, width) - for subshot in shots: + subshots = perspective_views_of_a_panorama(shot, subshot_width) + for subshot in subshots: urec.add_camera(subshot.camera) urec.add_shot(subshot) undistorted = render_perspective_view_of_a_panorama(