]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/blob - src/fft_fftw.h
Remove debug printf
[hercules2020/kcf.git] / src / fft_fftw.h
1 #ifndef FFT_FFTW_H
2 #define FFT_FFTW_H
3
4 #include "fft.h"
5
6 #ifndef CUFFTW
7   #include <fftw3.h>
8 #else
9   #include <cufftw.h>
10 #endif //CUFFTW
11
12 class Fftw : public Fft
13 {
14   public:
15     Fftw();
16     void init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales);
17     void set_window(const MatDynMem &window);
18     void forward(const MatScales &real_input, ComplexMat &complex_result);
19     void forward_window(MatScaleFeats &patch_feats_in, ComplexMat &complex_result, MatScaleFeats &tmp);
20     void inverse(ComplexMat &complex_input, MatScales &real_result);
21     ~Fftw();
22
23 protected:
24     fftwf_plan create_plan_fwd(uint howmany) const;
25     fftwf_plan create_plan_inv(uint howmany) const;
26
27 private:
28     cv::Mat m_window;
29     fftwf_plan plan_f = 0, plan_fw = 0, plan_i_1ch = 0;
30 #ifdef BIG_BATCH
31     fftwf_plan plan_f_all_scales = 0, plan_fw_all_scales = 0, plan_i_all_scales = 0;
32 #endif
33 };
34
35 #endif // FFT_FFTW_H