From e7e7e04dce59258843703ef5d44ad6b61d568aa6 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 5 Nov 2013 14:17:31 +0400 Subject: [PATCH] came back to relative error --- modules/ocl/test/test_imgproc.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/ocl/test/test_imgproc.cpp b/modules/ocl/test/test_imgproc.cpp index 634633a2a3..c7099a10cd 100644 --- a/modules/ocl/test/test_imgproc.cpp +++ b/modules/ocl/test/test_imgproc.cpp @@ -93,14 +93,22 @@ PARAM_TEST_CASE(ImgprocTestBase, MatType, generateOclMat(gdst_whole, gdst_roi, dst_whole, roiSize, dstBorder); } - void Near(double threshold = 0.0) + void Near(double threshold = 0.0, bool relative = false) { Mat roi, whole; gdst_whole.download(whole); gdst_roi.download(roi); - EXPECT_MAT_NEAR(dst_whole, whole, threshold); - EXPECT_MAT_NEAR(dst_roi, roi, threshold); + if (relative) + { + EXPECT_MAT_NEAR_RELATIVE(dst_whole, whole, threshold); + EXPECT_MAT_NEAR_RELATIVE(dst_roi, roi, threshold); + } + else + { + EXPECT_MAT_NEAR(dst_whole, whole, threshold); + EXPECT_MAT_NEAR(dst_roi, roi, threshold); + } } }; @@ -236,7 +244,7 @@ OCL_TEST_P(CornerMinEigenVal, Mat) cornerMinEigenVal(src_roi, dst_roi, blockSize, apertureSize, borderType); ocl::cornerMinEigenVal(gsrc_roi, gdst_roi, blockSize, apertureSize, borderType); - Near(1e-6); + Near(1e-5, true); } } @@ -256,7 +264,7 @@ OCL_TEST_P(CornerHarris, Mat) cornerHarris(src_roi, dst_roi, blockSize, apertureSize, k, borderType); ocl::cornerHarris(gsrc_roi, gdst_roi, blockSize, apertureSize, k, borderType); - Near(1e-6); + Near(1e-5, true); } }