11 void Fft::init(unsigned width, unsigned height, unsigned num_of_feats, unsigned num_of_scales)
15 m_num_of_feats = num_of_feats;
17 m_num_of_scales = num_of_scales;
23 void Fft::set_window(const MatDynMem &window)
25 assert(window.dims == 2);
26 assert(window.size().width == int(m_width));
27 assert(window.size().height == int(m_height));
31 void Fft::forward(const MatScales &real_input, ComplexMat &complex_result)
34 DEBUG_PRINT(real_input);
35 assert(real_input.dims == 3);
37 assert(real_input.size[0] == 1 || real_input.size[0] == int(m_num_of_scales));
39 assert(real_input.size[0] == 1);
41 assert(real_input.size[1] == int(m_height));
42 assert(real_input.size[2] == int(m_width));
44 assert(complex_result.cols = freq_size(cv::Size(m_width, m_height)).width);
45 assert(complex_result.rows = freq_size(cv::Size(m_width, m_height)).height);
46 assert(complex_result.channels() == uint(real_input.size[0]));
52 void Fft::forward_window(MatScaleFeats &patch_feats, ComplexMat &complex_result, MatScaleFeats &tmp)
54 assert(patch_feats.dims == 4);
56 assert(patch_feats.size[0] == 1 || patch_feats.size[0] == int(m_num_of_scales));
58 assert(patch_feats.size[0] == 1);
60 assert(patch_feats.size[1] == int(m_num_of_feats));
61 assert(patch_feats.size[2] == int(m_height));
62 assert(patch_feats.size[3] == int(m_width));
64 assert(tmp.dims == patch_feats.dims);
65 assert(tmp.size[0] == patch_feats.size[0]);
66 assert(tmp.size[1] == patch_feats.size[1]);
67 assert(tmp.size[2] == patch_feats.size[2]);
68 assert(tmp.size[3] == patch_feats.size[3]);
75 void Fft::inverse(ComplexMat &complex_input, MatScales &real_result)
78 DEBUG_PRINT(complex_input);
79 assert(real_result.dims == 3);
81 assert(real_result.size[0] == 1 || real_result.size[0] == int(m_num_of_scales));
83 assert(real_result.size[0] == 1);
85 assert(real_result.size[1] == int(m_height));
86 assert(real_result.size[2] == int(m_width));