[opencv] 74/89: test: fix mulSpectrums error tolerance

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sat May 13 09:57:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 2.4.13.2
in repository opencv.

commit 7bceef715c9d14353b134a42e236bd2782d9e511
Author: Alexander Alekhin <alexander.alekhin at intel.com>
Date:   Sat Dec 10 15:53:57 2016 +0300

    test: fix mulSpectrums error tolerance
---
 modules/core/test/test_dxt.cpp | 32 +++++++++-----------------------
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/modules/core/test/test_dxt.cpp b/modules/core/test/test_dxt.cpp
index 1b2995a..dad12ce 100644
--- a/modules/core/test/test_dxt.cpp
+++ b/modules/core/test/test_dxt.cpp
@@ -787,9 +787,7 @@ public:
 protected:
     void run_func();
     void prepare_to_validation( int test_case_idx );
-#if defined(__aarch64__) && defined(NDEBUG)
     double get_success_error_level( int test_case_idx, int i, int j );
-#endif
 };
 
 
@@ -797,31 +795,19 @@ CxCore_MulSpectrumsTest::CxCore_MulSpectrumsTest() : CxCore_DXTBaseTest( true, t
 {
 }
 
-#if defined(__aarch64__) && defined(NDEBUG)
 double CxCore_MulSpectrumsTest::get_success_error_level( int test_case_idx, int i, int j )
 {
+    (void)test_case_idx;
+    CV_Assert(i == OUTPUT);
+    CV_Assert(j == 0);
     int elem_depth = CV_MAT_DEPTH(cvGetElemType(test_array[i][j]));
-    if( elem_depth <= CV_32F )
-    {
-        return ArrayTest::get_success_error_level( test_case_idx, i, j );
-    }
-    switch( test_case_idx )
-    {
-        //  Usual threshold is too strict for these test cases due to the difference of fmsub and fsub
-        case 399:
-        case 420:
-            return DBL_EPSILON * 20000;
-        case 65:
-        case 161:
-        case 287:
-        case 351:
-        case 458:
-            return DBL_EPSILON * 10000;
-        default:
-            return ArrayTest::get_success_error_level( test_case_idx, i, j );
-    }
+    CV_Assert(elem_depth == CV_32F || elem_depth == CV_64F);
+
+    element_wise_relative_error = false;
+    double maxInputValue = 1000; // ArrayTest::get_minmax_bounds
+    double err = 8 * maxInputValue;  // result = A*B + C*D
+    return (elem_depth == CV_32F ? FLT_EPSILON : DBL_EPSILON) * err;
 }
-#endif
 
 void CxCore_MulSpectrumsTest::run_func()
 {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list