1

I would like to resize an n-dimensional grid similar to scipy.ndimage.affine_transform. For the stake of simplicity, I describe my problem with the 2-Dimensional case.

I need to downsample an image with an arbitrary non integer factor by more than 2 in both directions. The area of a new pixel represents more than the 4 neighbors (more than 2 in each axis). The resulting value should be a weighted average, for which the partially contained boarder pixels are only partially included in the average.

affine_transform with order=1 does bilinear interpolation and only considers the two closest pixels.

Is there a method (e.g. scipy) doing exactly that which I've overlooked?

Thank you in advance.

jared
  • 4,165
  • 1
  • 8
  • 31
checkThisOut
  • 621
  • 1
  • 5
  • 18
  • Look at https://pillow.readthedocs.io/en/stable/handbook/concepts.html#filters also https://stackoverflow.com/questions/tagged/image-resizing+python – denis Aug 11 '23 at 08:58

0 Answers0