0

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.

Sebastian H
  • 111
  • 3
  • I don't think there is - rotating an image by an angle other than 90 degrees is a lossy operation that introduces some blur. I don't think it's possible to undo that. You just have to store the original unrotated image. – Nick ODell Aug 07 '23 at 18:34

0 Answers0