row=512;  col=512;
fin_D04=fopen('D04.raw','r');
I_D04 = fread(fin_D04, [col row],'uint8=>uint8'); 
I_D04 = reshape(I_D04,row,col);
subplot(2,2,1)
imshow(I_D04);title('image D04.raw');
F_D04 = fftshift(fft2(I_D04));
Sc_D04 = abs(F_D04);
Sc_D04 = 18*log(Sc_D04);    %利用18*log去讓值落在0~255之間
subplot(2,2,2)
imshow(Sc_D04,[]);title('Fourier transform of image D04.raw');
fclose(fin_D04);

fin_D23=fopen('D23.raw','r');
I_D23 = fread(fin_D23, [col row],'uint8=>uint8'); 
I_D23 = reshape(I_D23,row,col);
subplot(2,2,3)
imshow(I_D23);title('image D23.raw');
F_D23 = fftshift(fft2(I_D23));
Sc_D23 = abs(F_D23);
Sc_D23 = 18*log(Sc_D23);    %利用18*log去讓值落在0~255之間
subplot(2,2,4)
imshow(Sc_D23,[]);title('Fourier transform of an image D23.raw');
fclose(fin_D23);
