Image Fourier transform (FFT with fast Fourier transform)

Source: Internet
Author: User

Study Dip 7th day, image Fourier transformHabitual, opening nonsense

Today the company's network do not know how, or not open csdn, the company has more than 100 aircraft, there is a limit speed of 60kb/s, as well as 3 K wages.

Image FFTThe previous article has introduced about the 2D FFT of the relevant knowledge, this is only introduced in the image of the application, for an image, a two-dimensional FFT, you can get its Fourier transform, Fourier transform is a two-dimensional complex matrix, because the two-dimensional array, if it is real, can be transformed to 0~ 255 is displayed by the grayscale image, and the transformation result is a complex number, so we display its amplitude, that is, the modulus of the complex, to show the Fourier spectrum (amplitude spectrum), not nonsense,:
OriginalFFT ResultsAs can be seen, the original image is the famous Lenna map, the following is the FFT of the amplitude spectrum, the main values are distributed around four vertices, the position coordinates of the images are expressed as (u,v), four vertices respectively (0,0), (0,max (v)), (Max (U), 0), (Max (U), Max (v)), as to why these four points, I did not study understand, but (0,0) near can be interpreted as low-frequency component more, but we usually see the figure of MATLAB in the image center, this step needs to pass a simple transformation, as long as the original map (coordinates for X, Y) when X+y is an even number, F (x, y) becomes its inverse, that is,-f (x, y), which we call shift, and we can get:
the amplitude spectrum after centering
the images in this image are clustered in the center of the image, similar to the results in MATLAB, but the MATLAB display more, the specific reason is unclear, but I feel matlabThe maximum value is processed because the difference between the maximum and the minimum value is too large, so after stretching the transform to 0~255, some results are less than 1 and cannot be displayed.
Center Local amplificationafter Fourier inverse transformation, then the image shift back, you can get the original picture, the following describes some of the transformation results:






#include "image_fft.h" void Fft_shift (double * Src,int size_w,int Size_h) {for (int. i=0;i<size_w;i++) {for (int        j=0;j<size_h;j++) {if ((i+j)%2) src[i*size_w+j]=-src[i*size_w+j];    }}}void Imagefft (iplimage * Src,complex * DST) {//fft_shift (src, src);    if (src->depth!=ipl_depth_8u) exit (0);    int width=src->width;    int height=src->height;    Double *image_data= (double*) malloc (sizeof (double) *width*height);        for (int i=0;i<width;i++) {for (int j=0;j

The next article continues to study the application of Fourier transform;

Image Fourier transform (FFT with fast 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.