correctly rotate a scipy.ndimage.rotate back

182 Views Asked by At

I rotate a image with scipy.ndimage in one direction and do a operation on it and than rotate it backwards. Is there a way/function/parameters to savegard that

  1. rotate a image by angle x
  2. rotate the rotated image by angle -x

results in the same image as before all the rotations.

For my current rotation I use the parameters:

import numpy as np
from scipy.ndimage import rotate

nodata = -999
rot1 = rotate(np.squeeze(local_array), x, reshape=True, cval=nodata, order=0,)
rot2 = rotate(rot1, -x, cval=nodata, order=0)

I that that, I have to filter the boundary manually and at least I have some uncertienties, where the images begin and end by about a row or column.

0

There are 0 best solutions below