The imresize command uses the bicubic method by bicubic . You can also specify one of several built-in methods or interpolation kernels, for example
imNewSize = imresize(imOldSize, sizeFactor, 'box')
for a box in the form of a box. If you want to specify your own kernel to order, you can pass this as a function descriptor along with the width of the kernel in an array of cells. For example, to implement a kernel in the form of a kernel (without using the built-in) with a kernel width of 4, try:
boxKernel = @(x)(-0.5 <= x) & (x < 0.5); imNewSize = imresize(imOldSize, sizeFactor, {boxKernel, 4});
If you type edit imresize and look inside the function, from line 893 you can find implementations of other built-in kernels, which may give you some clues about how you can implement your own.
source share