Gray-scale image--two-dimensional discrete Fourier transform in frequency domain filter Fourier transform

Source: Internet
Author: User
Tags scale image square root

Study Dip 24th Day

reproduced please indicate the source of this article: Http://blog.csdn.net/tonyshengtan, Welcome to reprint, found that the blog is reproduced in some forums, the image can not be normal display, unable to express my views, to this expression is very dissatisfied. Some sites reproduced my blog, very happy is that they write something more people see, but not happy is this paragraph was removed, also did not indicate the source of reprint, although this does not have the copyright protection, but the feeling is not very good, out of respect for the author's labor, reproduced please indicate the source!!!!

The opening crap .today to record is a two-dimensional discrete Fourier transform some properties, but also Fourier in the image processing to use some of the properties, so to focus on learning, and summarized under. Focus on the nature. Two-dimensional DFT mathematical formulaaccording to the one-dimensional discrete Fourier transform, the formula of two-dimensional DFT is given directly, the specific code implementation of this formula is mentioned in the previous article, but in fact, FFT is widely used as a fast algorithm because of the slow DFT calculation, the formula of DFT and IDFT is as follows:

the derivation process of two-dimensional DFT formula is the same as one-dimensional, the continuous Fourier transform is sampled or the original data period is copied after the Fourier series is computed, and then the main value is not discussed here.
Propertiesrelationship between space and frequency     for the image of MXN, and is the space sampling interval, so the total length of the original function is MX and NX, frequency domain interval u,v is the following relationship:

Therefore, the frequency domain sample interval is inversely proportional to the spatial sample interval. panning, rotating and centering    when the original image is translated or the frequency domain signal is moved, its corresponding frequency and airspace will also be transformed, the transformation relationship is as follows:
As can be seen, the frequency domain origin moves to (u0,v0), the corresponding airspace is the original signal and the back complex exponential signal product, this is also all the book to say the spectral centrality, namely (u0,v0) = (M/2,N/2), thus can obtain:
above ( -1) ^ (x+y), is M/2,N/2, brought into the obtained. for the rotation characteristics, we choose to use polar coordinates to represent the two-dimensional Cartesian coordinate system, thus having the following transformation properties:
It is concluded that the spectrum and airspace have rotational synchronization, that is, how many frequency domains rotate in the airspace, and how much is rotated in the frequency domain. The proof experiment is as follows:
Original
the spectrum after Fourier transform
the rotated picture
the spectrum after rotationDifferential Propertiesdifferential properties, that is, a differential Fourier transform of a signal has a amplification effect on high-frequency componentsf ' (x, y) <=>j*u*v*f (u,v)so the derivative can calculate the edge-the function of this high-frequency componentperiodicity and symmetry    The periodicity of DFT is consistent with the Fourier series of discrete periodic signals, that is, the original signal period, the spectrum is also period, and the image size is MXN:
the K1,K2 is an integer. Here is an illustration of the original spectrum and the central spectrum, from Gonzales:

It can be seen that the spectrum is a periodic arrangement. Some other symmetric transformation properties are summarized:
correspond to several special properties of the interpretation:

Fourier spectrum and phase angleThe result of the Fourier transform of the image is the complex matrix, because the complex number can not be used in the image display, so in the image we see are amplitude, which is the square root of the square sum of the real and imaginary parts of the result, that is, the length of the plural, but there is another nature of the plural, In other words, the phase stores the contour information of the image, or is called the mechanism information, and the amplitude stores the gray-scale information according to the experiment. Let 's take a look at the experiment:first of all, we get Lena Fourier transform results by FFT, that is, equal large complex matrix, we will all the length of the element is normalized, that is, the real and imaginary parts of each pixel divided by its distance, so that the amplitude of 1, but the different complex matrix, and then use Ifft to inverse, The results are calculated at around 0.001, to show that it is enlarged 1000 times times to show:
Original
Phase Angle ReconstructionNext we examine the magnitude of the effect, we set the phase angle of all elements to 45,135,225,315 degrees, that is, all the real and imaginary parts are set to their distance divided by the square root 2, so that the resulting IFFT results are as follows:
visible, amplitude has no effect on structure information. Code:
The amplitude is normalized to one, the phase angle remains unchanged, and the figure Complex is a complex data void Onerange (Complex *src,complex *dst,int width,int height) {        double realv=0.0, imaginv=0.0;    for (int i=0;i<width*height;i++) {        realv=src[i].real;        Imaginv=src[i].imagin;        Double distance=sqrt (REALV*REALV+IMAGINV*IMAGINV);        dst[i].real=realv/distance;        dst[i].imagin=imaginv/distance;            }    } The phase angle is normalized to one, the phase angles remain unchanged, and the figure Complex is the plural data void Oneangel (Complex *src,complex *dst,int width,int height) {        double realv=0.0, imaginv=0.0;    for (int i=0;i<width*height;i++) {        realv=src[i].real;        Imaginv=src[i].imagin;        Double distance=sqrt (REALV*REALV+IMAGINV*IMAGINV);        DST[I].REAL=DISTANCE/SQRT (2.0);        DST[I].IMAGIN=DISTANCE/SQRT (2.0);            }    }



two dimensional convolution theorem

convolution definition:

convolution relationships in frequency domain and airspace:
one problem with convolution is that after convolution, the period of the original signal is extended to a certain length, such as the convolution of a signal of length A and B, the signal length of the convolution result is a+b-1, so for the periodic signal, the result of convolution may cause the signal entanglement:
The solution to this problem is simple: the cycle is extended with 0, the length of a and B signal convolution, both A and B are expanded into a+b-1, with 0 padding. The images of F and H are convolution and are first extended:

SummaryAt this point, some properties of the image Fourier transform are briefly introduced, and the following table is summarized, which is convenient for later problems to be consulted:



next article about image obfuscation

Gray-scale image--two-dimensional discrete Fourier transform in frequency domain filter Fourier transform

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.