How to do the subpixel shift for of an original image multiple times with different values for each time.

Doubt: How to do the subpixel shift for of an original image multiple times with different values for each time.
Background: Lets say i have a gray image of 256x256 (called LR image), and i want to create a super-resolution of this LR image to 512x512 (called HR image). As, in most of the super resolution algorithm, we try to generate multiple LR image with multiple xshift and yshift values which happens to be the subpixel values (<1). Now using these multiple LRs, we try to get the HR using some kind of interpolation methods.
I am looking to do the xshift and yshift, say (0.5, 0.25) of an original image to generate first LR image. Once i get this, i can create multiple such shifts with different values of xshift and yshift.

2 comentarios

1. Take Fourier Transform of 256x256 image provided.
I=imread('256x256 input image');
LR1=I; [m1,n1]=size(I);
H=fft2(I);
2. x1=0.5;y1=0.25; u=0:1:255; v=0:1:255;
H1=H.*exp(-1i*2*pi.*(u*x1+v*y1)./(m1*n1));
LR2=real(ifft2(H1));
Fourier transforms are an expensive way to do image shifts. An image shift should be O(N), whereas with FFTs, it will be O(NlogN).

Iniciar sesión para comentar.

Respuestas (2)

Matt J
Matt J el 30 de En. de 2014
Editada: Matt J el 30 de En. de 2014
You can use IMTRANSFORM to make subpixel shifts of an image.
First I'd use imresize to go from 256 to 512. Then I'd use interp2 or griddedInterpolant to interpolate the interpixel values. imtransform will probably also work.

Categorías

Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 30 de En. de 2014

Comentada:

el 28 de Abr. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by