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.