0

I am trying to unwrap the interference pattern that I got from the interferometre. However, the first step would be to wrap the phase, because I just got an image (intensity). I cannot post the image, but it is concentric rings with some noise. I have followed the steps from the Takeda paper, that are basically:

  1. Hanning window
  2. FFT
  3. Butterworth filter
  4. IFFT

The first problem is that the third step should be applied to the first frequency order of the FFT, but MATLAB only gives me the 0 order in the FFT.

clear all

I3=im2double(imread('Int4.bmp'));
N=1024;
w=hann(N);          % hanning window 
m1 = w(:)*w(:).' ;  %' Create 2D window 
I1=I3(:,129:1152).*m1; 
D = fftshift(fft2(fftshift(I1)));%,2048,2048)); 

% Create Butterworth filter: 
nx=512; ny=512; d1=10; 
fftI=D(1:1023,1:1023); 
n=2; 
filter3 = ones(2*nx-1,2*ny-1); 

for i = 1:2*nx-1 
    for j =1:2*ny-1 
        dist = ((i-(nx+1))^2 + (j-(ny+1))^2)^.5; 
        filter3(i,j) = (1/(1 + (dist/d1)^(2*n))).*filter3(i,j); 
    end
end

% Update image with passed frequencies. 
filtered_image = ifftshift(ifft2(ifftshift(filter3.*fftI),N-1,N-1)) ;

I would appreciate any suggestion or comments.

Thank you very much!!

Rivera
  • 10,792
  • 3
  • 58
  • 102
  • 3
    If you cannot share real code / data, please provide fake code / data which still reproduce your issue. – Dmitry Grigoryev Jul 07 '15 at 10:05
  • This the code that I have. I am working with a bmp image called Int4, but you can call any other image if you want to try. Thank you for your help. – Sara Castillo Jul 07 '15 at 10:57
  • clear all I3=im2double(imread('Int4.bmp')); N=1024; w=hann(N);%hanning window m1 = w(:)*w(:).'; % Create 2D window I1=I3(:,129:1152).*m1; D = fftshift(fft2(fftshift(I1)));%,2048,2048)); % Create Butterworth filter: nx=512; ny=512; d1=10; fftI=D(1:1023,1:1023); n=2; filter3 = ones(2*nx-1,2*ny-1); for i = 1:2*nx-1 for j =1:2*ny-1 dist = ((i-(nx+1))^2 + (j-(ny+1))^2)^.5; filter3(i,j) = (1/(1 + (dist/d1)^(2*n))).*filter3(i,j); end; end; % Update image with passed frequencies. filtered_image = ifftshift(ifft2(ifftshift(filter3.*fftI),N-1,N-1)); – Sara Castillo Jul 07 '15 at 10:57
  • 1
    Please edit your original post to add the code, it is not legible in the comment section. – Hoki Jul 07 '15 at 11:12

0 Answers0