MATLAB: How to resize a rectangular image of size 1280×512 to a square image of size (2048×2048)? I have used the following code. Is it correct or is there any other better methods to perform resizing

image resizing

% First read the image I of size (1280x512) using imread, then used imresize to change the size of I to (2048x2048) and used imwrite to save the image
I=imread('I.tif');
J=imresize(I,[2048 2048],'bicubic');
imwrite(J,'J.tif','tiff');

Best Answer

It depends on your purpose. If the purpose is the human visual system, then you might possibly get more-appreciated output using imresize() with 'lanczos3'. See http://en.wikipedia.org/wiki/Lanczos_resampling#Limitations