fixed invalid output of cv::dft when using DFT_ROWS + DFT_COMPLEX_OUTPUT (http://code.opencv.org/issues/3428)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user