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

This commit is contained in:
Vadim Pisarevsky
2015-04-29 23:08:22 +03:00
parent 7918267d02
commit 74e2b8cbcb
2 changed files with 67 additions and 36 deletions

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);
}
}
}