I load and display an image of some rice in Matlab:
g = imread('rice.png'); imshow(g);
I take the FFT of this image and shift it:
G = fft2(g); imshow(log(abs(fftshift(G)) + 1), );
If I place a x and y axis trough the center of the image; I find that the image is symmetric g(-x,-y)=g(x,y). For a 1D signal we have that the FFT of a real signal has a symmetrical real part and an asymmetrical imaginary part. I guess that is what we see here in 2 dimensions?
Since the original image is darker at the bottom than at the top, there is a strong horizontal discontinuity at the periodic boundary causing the vertical line in the FFT.
I want to get rid of this boundary effect. A common approach to this seems to be windowing.
However I want to solve this problem by a technique I found in a paper called "mirroring". The paper was not very specific so I need your help in figuring out this approach :-).
First I create a symmetric "tile" from the original image:
tile=[flipdim(g,2) g; flipdim(flipdim(g,1),2) flipdim(g,1)]; imshow(tile);
Now I take the FFT of this "tile":
Tile=fft2(tile); imshow(log(abs(fftshift(Tile)) + 1), )
The vertical line seems to be (almost) gone: good. However the mirroring seem to have introduced more symmetry.
What is the correct result: the FFT of the original image or the FFT of the "mirrored" image?
Is there a way I can "mirror" so that I both get rid of boundary effects and get a purely real FFT?
Thanks in advance for any answers!