- if (n_channels > int(m_num_of_feats)) {
- for (uint i = 0; i < uint(n_channels); ++i) {
- cv::Mat in_roi(fw_all, cv::Rect(0, int(i * m_height), int(m_width), int(m_height)));
- in_roi = patch_feats[i].mul(m_window);
- }
- CufftErrorCheck(cufftExecR2C(plan_fw_all_scales, reinterpret_cast<cufftReal *>(real_input_arr),
- complex_result.get_p_data()));
- } else {
- for (uint i = 0; i < uint(n_channels); ++i) {
- cv::Mat in_roi(fw_all, cv::Rect(0, int(i * m_height), int(m_width), int(m_height)));
- in_roi = patch_feats[i].mul(m_window);
- }
- NORMAL_OMP_CRITICAL
- {
- CufftErrorCheck(
- cufftExecR2C(plan_fw, reinterpret_cast<cufftReal *>(real_input_arr), complex_result.get_p_data()));
- cudaStreamSynchronize(cudaStreamPerThread);
- }
+ assert(feat.dims == 3);
+ assert(n_channels == m_num_of_feats || n_channels == m_num_of_feats * m_num_of_scales);
+
+ for (uint i = 0; i < n_channels; ++i) {
+ cv::Mat feat_plane(feat.dims - 1, feat.size + 1, feat.cv::Mat::type(), feat.ptr<void>(i));
+ cv::Mat temp_plane(temp.dims - 1, temp.size + 1, temp.cv::Mat::type(), temp.ptr(i));
+ temp_plane = feat_plane.mul(m_window);