Two-dimensional Fourier transform and two-dimensional Fourier inverse transformationReprinted articles reproduced from: http://blog.sina.com.cn/s/blog_6c41e2f301016tpp.html
Transformation of images
1. Realization of Matlab with discrete Fourier transform
Matlab function FFT, fft2 and fftn can realize one-dimensional, two-dimension and N-dimensional DFT algorithm respectively; the invocation format of these functions is as follows:
A=fft (X,n,dim)
Where X represents the input image;
N represents the sampling interval, and if x is less than the value, then Matlab will fill the x 0,
Otherwise it will be intercepted, so that the length is N;
DIM indicates that you want to make a discrete Fourier transform.
A=FFT2 (X,mrows,ncols)
where Mrows and NCOLS specify an x size of 0 padding for x.
A=FFTN (X,size)
Where SIZE is a vector, each element will specify the length of the X corresponding dimension after 0 padding.
2. Matlab implementation of discrete Fourier inverse transform
Matlab functions Ifft, ifft2, and ifftn are used to calculate the inverse DFT. The call formats of the functions Ifft, ifft2, and ifftn are identical to the corresponding discrete Fourier transform functions.
Example: two-dimensional Fourier spectrum of images
% read in original image
Img=imread (' rabbit_0.bmp ');
I=rgb2gray (IMG); Imshow (I)
% seeking discrete Fourier spectrum
J=fftshift (fft2 (I));
K=log (ABS (J));
Figure
Subplot (1,2,1); Imshow (img,[]);
Subplot (1,2,2); Imshow (k,[]);
Six. For example
I=imread (' e:\w01.tif ');
Figure (1);
Imshow (i);
Colorbar;
J=FFT2 (i);
K=fftshift (j);
Figure (2);
L=log (ABS (k));
Imshow (l,[]);
Colorbar
N=IFFT2 (j)/255;
Figure (3);
Imshow (n);
Colorbar;