The way IMRESIZE implements interpolation is the calculation for each pixel in the output image (reverse mapping), the pixel indices in the input image that will be involved in the interpolation, together with the supporting weights.
Proximity and weight are determined by the type of interpolation core used, which, as @Albert points out , can be passed to the IMRESIZE function (the 'Method' property can take a {f,w} array of cells with a kernel function and a kernel width)
These two components will be used to compute a linear combination of input pixels to fill each value of the output pixels. This process is performed for each measurement separately once at a time (vertically, then horizontally).
Now the problem is that you can never get the median value using a linear combination, because the median is a non-linear ordering filter. Therefore, your only option is to write your own implementation ...
source share