The application of Fourier transform in image processing

Source: Internet
Author: User
Tags scale image

Directory

1. Understanding the definition of a two-dimensional Fourier transform 2

1.1 Two-dimensional Fourier transform 2

1.2 Two-dimensional discrete Fourier transform 2

1.3 using FFT to calculate two-dimensional discrete Fourier transform 3

1.3 Physical significance of image Fourier transform 4

2. What are the properties of the two-D Fourier transform? 5

2.1 Properties of two-dimensional discrete Fourier transform 5

2.2 Two-dimensional discrete Fourier transform image properties 6

3. Either give an image, two-dimensional Fourier transform and inverse transform 7

4. Appendix 9

4.1matlab Code 9

4.2 References 10

1. Understanding the definition of two-dimensional Fourier transform 1.1 two-dimensional Fourier transform

Two-dimensional Fourier transformation:

Inverse transformation:

1.2Two-dimensional discrete Fourier transform

a discrete Fourier transform of a function with an image size of MXN is given by the following equation:


Which and. where the variables u and v are used to determine their frequency, the frequency domain system is made up of spanned coordinate systems, where and as (frequency) variables. The spatial domain is the coordinate system spanned by f (x, y) . The spectral components of the spectrum system in the four corners of the spectrum graph are obtained by 0.

The discrete Fourier inverse transformation is given by the following formula:

So that R and I represent the real and required parts of F respectively, then the Fourier spectrum, phase angle, power spectrum (amplitude) is defined as follows:


1.3 using FFT to calculate two-dimensional discrete Fourier transform

The two-dimensional discrete Fourier transform is defined as:

Two-dimensional discrete Fourier transform can be achieved by two-time one-dimensional discrete Fourier transform:

1) One-dimensional n-point DFT (once for each m, total M-times)

2) DFT for M-point (once for each k, total n times)


This two-time discrete Fourier transform can be obtained by a fast algorithm, if M and N are the power of 2, you can use the base two FFT algorithm, the number of times required to multiply

The number of multiplication times required to calculate the two-dimensional discrete Fourier transform directly is (m+n) MN, and when M and N are large, it can save a lot of computation by using FFT operation.

The physical meaning of 1.3 image Fourier transform

The frequency of the image is the index of the intensity of the gray intensity in the image, and it is the gradient of the gray level in the plane space. such as: a large area of the desert in the image is a region of slow gray-scale changes, the corresponding frequency value is very low, and for the Surface attribute transformation of the sharp edge region in the image is a sharp change in the area of gray, the corresponding frequency value is higher. Fourier transform has a very obvious physical meaning in practice, and f is an analog signal with limited energy, then its Fourier transform represents the spectrum of F. From a purely mathematical point of view, Fourier transforms a function into a series of periodic functions to be processed. From the physical effect, the Fourier transform transforms the image from the spatial domain to the frequency domain, and its inverse transformation is to convert the image from the frequency domain to the spatial domain. In other words, the physical meaning of the Fourier transform is to transform the gray-scale distribution function of the image into the frequency distribution function of the image.

Fourier inverse transformation is to transform the frequency distribution function of an image into a gray-scale distribution function Fourier transform before, the image (uncompressed bitmap) is a set of points that are sampled on the continuous space (real space), usually a two-dimensional matrix is used to represent the space points, denoted as z=f (x, y). Because space is three-dimensional, the image is two-dimensional, so the relationship of the object in the space must be represented by the gradient, so that we can observe the image of the object in the three-dimensional space of the corresponding relationship.

Fourier spectrum Map We see the bright and dark light, the meaning is that the image of a point and the neighboring points of the difference between the strength, that is, the size of the gradient, that is, the frequency of the point (so to understand that the low-frequency part of the image refers to the lower gradient point, high-frequency part of the opposite). Generally speaking, the gradient is large, the brightness of the point is strong, otherwise the point brightness is weak. In this way, by observing the Fourier transform Spectrum Map, also known as the Power map, we can intuitively see the image of the energy distribution: if the spectral map of the number of darker points, then the actual image is relatively soft (because the difference between the point and the neighborhood is not small, the gradient is relatively small); Conversely, if the spectrum map has more points, Then the actual image must be sharp, the boundary is clear, and the pixels on both sides of the boundary are large.

After the spectrum shift to the origin, it can be seen that the frequency distribution of the image is centered on the origin and symmetrically distributed. Moving the spectrum to the center of the circle in addition to clearly see the image frequency distribution, there is also a benefit, it can isolate the periodic pattern of interference signals, such as sinusoidal interference. If a spectrum map with sinusoidal interference, the frequency shift to the origin can be seen, in addition to the center there is another point-centered, symmetrical distribution of the highlight set, this set is the noise generated by interference. It is intuitively possible to eliminate interference by placing a band-stop filter at that position.

2. What are the properties of the two-D Fourier transform? 2.1 Properties of two-dimensional discrete Fourier transform

1) separation

Separation of two-dimensional discrete Fourier transform

The main advantage of separating property is that it can be obtained by using a series of one Viffoury leaf transform. The 1th step is to take the transformation along each line, multiply the result by 1/n, get the two-dimensional function, 2nd step, take the transformation along each column, and multiply the result by 1/n. This method is the first after column. The result is the same if the order is preceded by a column.


The inverse transform f (x, Y) can also be similar in two steps.

2) Translational Nature

The displacement properties of Fourier transform and inverse transform pairs are:

The Fourier transform multiplied by the exponential term and its product, the origin of the frequency plane is shifted to. Similarly, by multiplying the exponent term and taking its inverse transformation, the origin of the spatial domain plane is shifted moves n/2, the exponent term is:

That is

Thus, by multiplying (X+y), the Fourier transform origin can be moved to the center of the n*n frequency square to see the entire spectrum. In addition, the translation of the pair does not affect the amplitude of its Fourier transform.

In addition, as with the continuous two-dimensional Fourier transform, the two-dimensional discrete Fourier transform also has the properties of periodicity , conjugate symmetry, linearity, rotation, correlation theorem, convolution theorem and proportionality . These properties are of great significance in the analysis and processing of images.

2.2 Two-dimensional discrete Fourier transform image properties

1, the image after two-dimensional Fourier transform, its transformation coefficient matrix has the following properties: If the transformation matrix origin is located in the center, its spectral energy concentration is located near the center of the transformation coefficient short matrix (shadow region). If the origin of the two-dimensional Fourier transform matrix is located in the upper-left corner, then the energy of the image signal will be concentrated on the four corners of the coefficient matrix. This is determined by the nature of the two-dimensional Fourier transform itself. At the same time, it is shown that the energy concentration in low frequency region.

2, the image of the region of slow gray changes, corresponding to its transformation of the low-frequency component of the region, the image gray-scale gradient, corresponding to the transformation of the high-frequency component part. In addition to the particle noise, the edges and contours of the image details are the mutation regions of gray scale, and they all have the high frequency component characteristics after transformation.

3. Give an image, two-dimensional Fourier transform and inverse transformation

Original

Two-dimensional Fourier transform

Inverse transformation

Spectrum map

original

add Gaussian mania

add salt and pepper Mania

 

Gaussian noise median filter

Salt and pepper Mania median filter

Arithmetic mean filtering for Gaussian mania

Arithmetic mean filtering for salt and pepper mania

4. Appendix 4.1matlab Code

1) Procedure One

[I,lcmp]=imread (' f:/123.jpg ');%======= read image display image

Subplot (2,2,1), Imshow (I,LCMP);

Title (' original ');

Ii=im2double (i); %===== Convert the image matrix type to double (many of the image calculations can not be used with integer type), no this will be an error!! , and if you don't use this, you have to convert to grayscale!

I1 = fft2 (ii); %====== Fourier transform

I2 =fftshift (I1); %====== moves the frequency image of the transformation to the center (the original good part is now moving center in the Four Corners, which facilitates the subsequent processing)

I3=log (ABS (I2)); %===== Display Center low frequency section, plus logarithm is for better display

Subplot (2,2,2), Imshow (i3,[]);

Title (' Fourier ');

Map=colormap (LCMP); %=== extraction Chromatography

Imwrite (I3,map, ' f:/ffttank.bmp '); %=== Enter the above i3 into the Ffttank file

i5 = Real (ifft2 (Ifftshift (I2))); %=== frequency domain graph inversion to airspace and take the real part

I6 = Im2uint8 (Mat2gray (i5)); %=== to take its grayscale image

Imwrite (I6,map, ' f:/tank2.bmp ', ' bmp '); %=== restore images using grayscale and original color templates

Subplot (2,2,3), Imshow (I6);

Title (' Anti-fourier ');

I7=rgb2gray (i);

I8=FFT2 (i7);%=== can be normalized to a grey figure. Because it's a 2-dimensional matrix, a color graph is a 3-dimensional matrix that needs to be converted to 2-dimensional gray.

M=fftshift (i8); % DC component moved to Spectrum Center

%rr=real (m); % Fourier transform the real part

%ii=imag (m); % of the imaginary part of Fourier transform

A=abs (m);% calculate spectral amplitude

%A=SQRT (rr.^2+ii.^2);

A= (A-min (min (a)))/(Max (Max (a))-min (min (a))) *225; % Normalization

Subplot (2,2,4), Imshow (A); % Display Original image

Colorbar; % display the color bar of the image

Title (' FFT Spectrum '); % image naming

2) Program Two

M=imread (' f:/123.jpg ');

M=rgb2gray (m); %== Filter function is a two-dimensional gray-scale image, TIF can be directly filtered

Subplot (3,3,1)

Imshow (M);% Show Original image

Title (' original ')

P1=imnoise (M, ' Gaussian ', 0.02); % added Gaussian mania

Subplot (3,3,2)

Imshow (P1)% add Gaussian mania to display images

Title (' Gaussian Noise ');

P2=imnoise (M, ' salt & Pepper ', 0.02); %= add salt and pepper mania

Subplot (3,3,3)

Imshow (P2) to display images after adding salt and pepper mania

Title (' Salt & pepper noise ');

G=MEDFILT2 (P1); % to Gaussian noise median filter

Subplot (3,3,5)

Imshow (g)

Title (' Medfilter Gaussian ')

H=MEDFILT2 (P2); % of salt and pepper Mania median filter

Subplot (3,3,6)

Imshow (h)

Title (' Medfilter Salt & pepper Noise ')

L=[1 1 1 for Gaussian noise arithmetic mean filter

1 1 1

1 1 1];

L=L/9;

K=conv2 (p1,l);

Subplot (3,3,8)

Imshow (k,[])

Title (' Arithmeticfilter Gaussian ')

% of salt and pepper mania arithmetic mean filter

D=conv2 (p2,l);

Subplot (3,3,9)

Imshow (d,[])

Title (' Arithmeticfilter Salt & pepper Noise ')

4.2 References

[1] Mengfan Wen, Wuluzhen. Research on two-dimensional Fourier transform based on FTP. Laser and infrared. Volume 38th 9th September 2008

[2] Dong Jian, Deng, Li Jinwu. The research of image transformation is realized based on two-dimensional Fourier transform. Fujian computer. 2015 issue 9th

The application of Fourier transform in image processing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.