fixed invalid output of cv::dft when using DFT_ROWS + DFT_COMPLEX_OUTPUT (http://code.opencv.org/issues/3428)

This commit is contained in:
Rostislav Vasilikhin
2016-09-05 22:32:57 +03:00
parent 6d691f2e05
commit 27dd27400a
2 changed files with 68 additions and 36 deletions
+21
View File
@@ -866,3 +866,24 @@ protected:
};
TEST(Core_DFT, complex_output) { Core_DFTComplexOutputTest test; test.safe_run(); }
TEST(Core_DFT, complex_output2)
{
for (int i = 0; i < 100; i++)
{
int type = theRNG().uniform(0, 2) ? CV_64F : CV_32F;
int m = theRNG().uniform(1, 10);
int n = theRNG().uniform(1, 10);
Mat x(m, n, type), out;
randu(x, -1., 1.);
dft(x, out, DFT_ROWS | DFT_COMPLEX_OUTPUT);
double nrm = norm(out, NORM_INF);
double thresh = n*m * 2;
if (nrm > thresh)
{
cout << "x: " << x << endl;
cout << "out: " << out << endl;
ASSERT_LT(nrm, thresh);
}
}
}