This is the transformation I did.
The code fft2()
the Lena picture than ifft2()
it back to the original. Add some abs()
so it actually displays it.
According to this post an image cannot be reconstructed without the phase information, yet I see no indication of phase being used anywhere here.
I'm guessing MATLAB still uses it but keeps it out of sight for convinve. If so is it possible to view the phase component of a given picture as well as the magnitude spectrum?
CODE:
[x,map] = imread('PATH'); %import image
i = ind2gray(x,map); % to greyscale
I = fft2(i); % 2D FFT
I = fftshift(I); % centre
ir = ifft2(I);
figure(1); imshow(abs(i),[]) % original
figure(2); imshow(log(double(abs(I))),[]) % original
figure(3); imshow(abs(ir),[]) % original
I guess I worded this really badly. How do I see the phase plot of the image's transform? I guess that sounds less stupid.
x
is your image and you lety = fft2(x)
, theny
will be complex valued. If you want to look at the phase, just use theangle
function. $\endgroup$