From c5a3864a4d23f2c0d15e61034ca2d530f69556aa Mon Sep 17 00:00:00 2001 From: Josef Brandt Date: Wed, 17 Jun 2020 16:01:27 +0200 Subject: [PATCH] Hotfix in creating viewtiles Rotation contributions of transformation matrix were neglected, they are now properly taken into account. --- scenePyramid.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scenePyramid.py b/scenePyramid.py index 3828c11..3cac81c 100644 --- a/scenePyramid.py +++ b/scenePyramid.py @@ -592,12 +592,10 @@ class ScenePyramid: # add to v(i, j) tile = self.readViewTile(slice_nr, i, j) size = (tile.shape[self.npWidthIdx], tile.shape[self.npHeightIdx]) # (w, h) - # translation matrix - m = np.float32([ - [1, 0, src_tile_pos_x], - [0, 1, cur_src_tile_pos_y] - ]) - cv2.warpAffine(current_src_img, m, size, tile, borderMode=cv2.BORDER_TRANSPARENT) + m_rot[0, 2] = src_tile_pos_x + m_rot[1, 2] = cur_src_tile_pos_y + + cv2.warpAffine(current_src_img, m_rot, size, tile, borderMode=cv2.BORDER_TRANSPARENT) self.saveViewTile(tile, slice_nr, i, j) cur_src_tile_pos_y -= view_tile_height src_tile_pos_x -= view_tile_width -- GitLab