我正在正确获取图像的2d-fft,
但无法从同一张图片的2d-fft中获得相反的结果。
从同一张图片的2d-fft取反的正确调用是什么?
// for 2d-fft. This I am getting properly
kiss_fftnd_cfg st = kiss_fftnd_alloc(dims, ndims, 0, 0, 0);
kiss_fftnd(st,(kiss_fft_cpx *)fftbuf,(kiss_fft_cpx *)fftoutbuf);
// for inverse. By using this I am getting the wrong values.
kiss_fftndr_cfg st2 = kiss_fftndr_alloc(dims, ndims, 1, 0, 0);
kiss_fftndri(st2, (kiss_fft_cpx *)fftoutbuf, (kiss_fft_scalar *)obuf);
// even I have tried this. By using this I am getting the wrong values.
kiss_fftr_cfg st3 = kiss_fftr_alloc( (rows * cols) , 1, 0, 0);
kiss_fftri( st3 , (kiss_fft_cpx *)fftoutbuf ,(kiss_fft_scalar *)rbuf);
答案 0 :(得分:0)
您正在混合复杂的FFT和真实的FFT。
正向/反向行为由* alloc函数的第三个参数inverse_fft
(即复数kiss_fftnd_alloc
和实数kiss_fftndr_alloc
)控制。