Lines Matching full:rows
201 void testC2C(const std::string& hint, int cols, int rows, int flags, bool inplace)
205 cv::Mat a = randomMat(cv::Size(cols, rows), CV_32FC2, 0.0, 10.0);
215 d_b = cv::cuda::GpuMat(a.rows, a.cols, CV_32FC2, d_b_data.ptr(), a.cols * d_b_data.elemSize());
217 cv::cuda::dft(loadMat(a), d_b, cv::Size(cols, rows), flags);
222 EXPECT_MAT_NEAR(b_gold, cv::Mat(d_b), rows * cols * 1e-4);
229 int rows = randomInt(2, 100);
235 testC2C("no flags", cols, rows, 0, inplace);
236 testC2C("no flags 0 1", cols, rows + 1, 0, inplace);
237 testC2C("no flags 1 0", cols, rows + 1, 0, inplace);
238 testC2C("no flags 1 1", cols + 1, rows, 0, inplace);
239 testC2C("DFT_INVERSE", cols, rows, cv::DFT_INVERSE, inplace);
240 testC2C("DFT_ROWS", cols, rows, cv::DFT_ROWS, inplace);
241 testC2C("single col", 1, rows, 0, inplace);
243 testC2C("single col inversed", 1, rows, cv::DFT_INVERSE, inplace);
253 void testR2CThenC2R(const std::string& hint, int cols, int rows, bool inplace)
257 cv::Mat a = randomMat(cv::Size(cols, rows), CV_32FC1, 0.0, 10.0);
265 d_b_data.create(1, (a.rows / 2 + 1) * a.cols, CV_32FC2);
266 d_b = cv::cuda::GpuMat(a.rows / 2 + 1, a.cols, CV_32FC2, d_b_data.ptr(), a.cols * d_b_data.elemSize());
270 d_b_data.create(1, a.rows * (a.cols / 2 + 1), CV_32FC2);
271 d_b = cv::cuda::GpuMat(a.rows, a.cols / 2 + 1, CV_32FC2, d_b_data.ptr(), (a.cols / 2 + 1) * d_b_data.elemSize());
274 d_c = cv::cuda::GpuMat(a.rows, a.cols, CV_32F, d_c_data.ptr(), a.cols * d_c_data.elemSize());
277 cv::cuda::dft(loadMat(a), d_b, cv::Size(cols, rows), 0);
278 cv::cuda::dft(d_b, d_c, cv::Size(cols, rows), cv::DFT_REAL_OUTPUT | cv::DFT_SCALE);
286 EXPECT_MAT_NEAR(a, c, rows * cols * 1e-5);
293 int rows = randomInt(2, 100);
295 testR2CThenC2R("sanity", cols, rows, false);
296 testR2CThenC2R("sanity 0 1", cols, rows + 1, false);
297 testR2CThenC2R("sanity 1 0", cols + 1, rows, false);
298 testR2CThenC2R("sanity 1 1", cols + 1, rows + 1, false);
299 testR2CThenC2R("single col", 1, rows, false);
300 testR2CThenC2R("single col 1", 1, rows + 1, false);
304 testR2CThenC2R("sanity", cols, rows, true);
305 testR2CThenC2R("sanity 0 1", cols, rows + 1, true);
306 testR2CThenC2R("sanity 1 0", cols + 1, rows, true);
307 testR2CThenC2R("sanity 1 1", cols + 1, rows + 1, true);
322 C.create(std::abs(A.rows - B.rows) + 1, std::abs(A.cols - B.cols) + 1, A.type());
327 dftSize.height = cv::getOptimalDFTSize(A.rows + B.rows - 1);
334 cv::Mat roiA(tempA, cv::Rect(0, 0, A.cols, A.rows));
336 cv::Mat roiB(tempB, cv::Rect(0, 0, B.cols, B.rows));
341 cv::dft(tempA, tempA, 0, A.rows);
342 cv::dft(tempB, tempB, 0, B.rows);
349 // Even though all the result rows will be non-zero,
350 // you need only the first C.rows of them, and thus you
351 // pass nonzeroRows == C.rows
352 cv::dft(tempA, tempA, cv::DFT_INVERSE + cv::DFT_SCALE, C.rows);
355 tempA(cv::Rect(0, 0, C.cols, C.rows)).copyTo(C);