0
$\begingroup$

Here is two similar images. I did 2D Fourier Transform for both of them. But for the first image, the result shows as a ring and for the second image the 2D FFT shows as a-two-ring. Examples R listed in the following.

Input image 1 : (For this figure the FFT is a ring.) enter image description here

Input image 2: (For this figure the FFT is a two-ring.) enter image description here

Could someone explain the results in the view of Fourier Transform quantitatively? Maybe from the basic theory and calculation of Fourier Transform? Maybe introduction of the auto-correlation function? Any other suggestions are welcomed.

$\endgroup$
9
  • $\begingroup$ Do you understand how to interpret the spectrum; radius = frequency etc? $\endgroup$ Oct 9, 2015 at 14:32
  • $\begingroup$ In my view, one ring in FFT means in original image there is a certain regular distance and orginal image is isotropic....so in the two ring case it might be the reslut of two different regular distances in original image...But in figure 2, I can not find out obvious single supporting the hypothesis.. $\endgroup$
    – Cici
    Oct 9, 2015 at 14:41
  • $\begingroup$ The two rings are actually quite close in wavelength, outer ring maybe 4 pixels, inner ring maybe 8 pixels. To see what they correspond to, zero the rest of the spectrum and then do the IFFT, for each ring. $\endgroup$ Oct 9, 2015 at 14:49
  • $\begingroup$ Actually I am new in matlab or mathmatica...I only know a little about the FFT and programming...I will try iFFT later..But another question comes here...Two-ring in the FFT can be simply divided into the superposition of the bigger ring and smaller ring? $\endgroup$
    – Cici
    Oct 9, 2015 at 14:59
  • $\begingroup$ Yes, that is why FFT is so commonly used, it is all linear. Each point in in the spectrum represents the amplitude and phase of a sinusois at a particular frequency and orientation. Add all those sinusoids together and you get the original image. Add only a subsection together you get a filtered image. If you link to the original files I can write some code to demonstrate. $\endgroup$ Oct 10, 2015 at 0:03

1 Answer 1

0
$\begingroup$

Here is some code that will let you interactively make a mask and see the difference.

For the first image the dark edges and the bright centres are about the same width, so there is only one ring. For the second image, the dark edges are half the size of the bright centres, hence two rings.

I1 = imread('sefft1.jpg');
I2 = imread('sefft2.jpg');

I1g = rgb2gray(I1);
I2g = rgb2gray(I2);

I1gFFT = fft2(I1g);
I2gFFT = fft2(I2g);

imagesc(log(abs(fftshift(I1gFFT))))
imagesc(log(abs(fftshift(I2gFFT))))

% FFT coordinates
[rows,cols] = size(I1gFFT);

[ux, uy] = meshgrid(([1:cols]-(fix(cols/2)+1))/(cols-mod(cols,2)), ...
    ([1:rows]-(fix(rows/2)+1))/(rows-mod(rows,2)));
ux = ifftshift(ux);   % Quadrant shift to put 0 frequency at the corners
uy = ifftshift(uy);

% Convert to polar coordinates
th = atan2(uy,ux);
r = sqrt(ux.^2 + uy.^2);

% Centred versions
rc = fftshift(r);
thc = fftshift(th);

% Interactive selection of filter
imagesc(log(abs(fftshift(I1gFFT))));
title('Image 1: Press enter to select max and min freq');
pause;
title('select max and min freq');
[x,y] = ginput(2);
y = round(y)
x = round(x)
r1 = rc(y(1),x(1));
r2 = rc(y(2),x(2));
rmin = min(r1,r2);
rmax = max(r1,r2);
mask = (r > rmin) & (r < rmax);
maskc = (rc > rmin) & (rc < rmax);

imagesc(log(abs(fftshift(I1gFFT).*maskc))); title('Masked area'); pause;
imagesc(ifft2(I1gFFT.*mask)); title('Result of ifft of masked area'); pause;
imagesc(ifft2(I1gFFT.*(1-mask))); title('Result of ifft of non-masked area'); pause;

% Interactive selection of filter
imagesc(log(abs(fftshift(I2gFFT))));
title('Image 2: Press enter to select max and min freq');
pause;
title('select max and min freq')
[x,y] = ginput(2);
y = round(y)
x = round(x)
r1 = rc(y(1),x(1));
r2 = rc(y(2),x(2));
rmin = min(r1,r2);
rmax = max(r1,r2);
mask = (r > rmin) & (r < rmax);
maskc = (rc > rmin) & (rc < rmax);

imagesc(log(abs(fftshift(I2gFFT).*maskc))); title('Masked area'); pause;
imagesc(ifft2(I2gFFT.*mask)); title('Result of ifft of masked area'); pause;
imagesc(ifft2(I2gFFT.*(1-mask))); title('Result of ifft of non-masked area'); pause;
$\endgroup$
1
  • $\begingroup$ TKS SO much..I will check the program later...Anyway, TKS too too too much.. $\endgroup$
    – Cici
    Oct 10, 2015 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.