相位相关:
void PhaseCorrelation( UChar *ref , UChar *tpl , double *poc , int width , int height ) {
int i, j, k;
double tmp;
int step = width;
int fft_size = width * height;
/* setup pointers to images */
UChar *ref_data = ( UChar* ) ref;
UChar *tpl_data = ( UChar* ) tpl;
double *poc_data = ( double* ) poc;
/* allocate FFTW input and output arrays */
fftw_complex *img1 = ( fftw_complex* )fftw_malloc( sizeof( fftw_complex ) * width * height );
fftw_complex *img2 = ( fftw_complex* )fftw_malloc( sizeof( fftw_complex ) * width * height );
fftw_complex *res = ( fftw_complex* )fftw_malloc( sizeof( fftw_complex ) * width * height );
/* setup FFTW plans */
fftw_plan fft_img1 = fftw_plan_dft_1d( width * height, img1, img1, FFTW_FORWARD, FFTW_ESTIMATE );
fftw_plan fft_img2 = fftw_plan_dft_1d( width * height, img2, img2, FFTW_FORWARD, FFTW_ESTIMATE );
fftw_plan ifft_