Configuration environment: windows7+vs2012
To download the resource bundle, unzip for example to:
In order to embed the VS2012, the corresponding LIB file is needed, then the VS2012 is used to generate the corresponding LIB file.
Find four files in the Vs2012/common7/ide directory such as the following:
Place these four files in the Vs2012/vc/bin directory:
In the CMD operation for example the following:
When the above occurs, it means that lib.exe can perform normally
Enter the following command:
Lib/machine:i386/def:libfftw3-3.def
Lib/machine:i386/def:libfftw3f-3.def
Lib/machine:i386/def:libfftw3l-3.def
The corresponding lib file is generated.
Put the above files into the VS2012 installation directory, Fftw3.h put into the Include directory, the corresponding LIB file into the Lib directory, DLL files into the Windows/system32 directory, configuration is complete.
Next Test FFTW Library:
Create a new project in VS2012:
Include header files such as the following:
#include "stdafx.h" #include "fftw3.h" #include "iostream" #include <stdio.h> #include <stdlib.h># Include <string.h> #include "opencv.hpp" using namespace cv;using namespace std;
After joining, copy a code such as the following:
void Test2 () {Fftw_complex *in, *out; Fftw_plan p; int n= 8; int i; Int J; in = (fftw_complex*) fftw_malloc (sizeof (FFTW_COMPLEX) * N); out = (fftw_complex*) fftw_malloc (sizeof (FFTW_COMPLEX) * N); for (i=0; i < N; i++) { in[i][0] = 1.0; IN[I][1] = 0.0; printf ("%6.2f", In[i][0]); } printf ("\ n"); P=FFTW_PLAN_DFT_1D (N,in,out, Fftw_forward, fftw_estimate); Fftw_execute (P); for (j = 0;j < n;j++) { printf ("%6.2f", Out[j][0]); } printf ("\ n"); Fftw_destroy_plan (p); Fftw_free (in); Fftw_free (out); System ("Pause");} int main () { test2 (); System ("pause"); return 0; }
Test results such as the following:
The FFT operation of the image is tested such as the following:
FFTW Library +vs2012 Configuration