Why do I receive unexpected results when using FFT2/IFFT2 with a sequence of image arithmetic functions? I have an image on which I perform some operations in the frequency domain. I do this by using FFT2 to transform the image, and use image processing functions such as IMADD, IMSUBTRACT, etc. to change the transformed image. I then use IFFT2 to change the image back from the frequency domain. However, the image does not look like I would expect, and does not seem to have any of the features of the original image.
Kshitij Singh answered .
2025-11-20
I = imread('moon.tif');
% convert to double
ID = im2double(I);
% transform to frequency domain
FID = fft2(ID);
% insert image arithmetic operations here
% convert back to spatial domain
IFID = ifft2(FID);
% convert back to uint8
I8 = im2uint8(IFID);