1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| const int Npoints(widget.imagelistWidget->count());
fftw_complex *in, *out;
in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*Npoints);
out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*Npoints);
for(int k=0;k<liste.size();k++)
{
double moyp= qGray(pixelfft);
in[k][0] = moyp;
in[k][1] = 0.0;
}
p = fftw_plan_dft_1d(Npoints, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(p);
//resultat
QVector<qreal> realV;
QVector<qreal> imgV;
for (int i = 0; i < Npoints; i++)
{
realV.append(out[i][0]);
imgV.append(out[i][1]);
}
for(int l=0;l<liste.size();++l)
{
double resfft=atan2(imgV[l],realV[l]);//calcul phase
} |
Partager