I want to rotate an image in frequency domain. However there is something in picture like aliasing. What is the problem and how can I solve it? Assume that, I only have FFT result of the image and know the rotation angle in image domain.
My code and samples pictures are below:
close all
f=imread('cameraman.tif');
theta=pi/3;
T=[cos(theta) sin(theta) 0;
-sin(theta) cos(theta) 0
0 0 1];
t2 = maketform('affine',T);
g2 = imtransform(f,t2);
figure,imshow(f),title('Original image') % original image
figure,imshow(g2),title('Rotate image') % rotated image
f_shift = fftshift(f);
f_fft = fftshift(fftn(f_shift));
g2 = imtransform(f_fft,t2); % rotation frequency domain
figure,imshow(abs(g2),[]),imcontrast % rotation in frequency domain
image_rotate = ifftshift(ifftn(g2));
figure,imshow(abs(image_rotate),[]) % result in image domain