Commit 3a1a3da7 authored by Alexander Alekhin's avatar Alexander Alekhin

fix tests

parent f104d5be
...@@ -158,7 +158,7 @@ OCL_TEST_P(CvtColor, YCrCb2BGRA) { performTest(3, 4, CVTCODE(YCrCb2BGR)); } ...@@ -158,7 +158,7 @@ OCL_TEST_P(CvtColor, YCrCb2BGRA) { performTest(3, 4, CVTCODE(YCrCb2BGR)); }
#if IPP_VERSION_X100 > 0 #if IPP_VERSION_X100 > 0
#define IPP_EPS depth <= CV_32S ? 1 : 4e-5 #define IPP_EPS depth <= CV_32S ? 1 : 4e-5
#else #else
#define IPP_EPS 0 #define IPP_EPS 1e-3
#endif #endif
OCL_TEST_P(CvtColor, RGB2XYZ) { performTest(3, 3, CVTCODE(RGB2XYZ), IPP_EPS); } OCL_TEST_P(CvtColor, RGB2XYZ) { performTest(3, 3, CVTCODE(RGB2XYZ), IPP_EPS); }
......
...@@ -146,7 +146,7 @@ PARAM_TEST_CASE(CalcBackProject, MatDepth, int, bool) ...@@ -146,7 +146,7 @@ PARAM_TEST_CASE(CalcBackProject, MatDepth, int, bool)
scale = randomDouble(0.1, 1); scale = randomDouble(0.1, 1);
} }
virtual void test_by_pict() void test_by_pict()
{ {
Mat frame1 = readImage("optflow/RubberWhale1.png", IMREAD_GRAYSCALE); Mat frame1 = readImage("optflow/RubberWhale1.png", IMREAD_GRAYSCALE);
...@@ -174,7 +174,19 @@ PARAM_TEST_CASE(CalcBackProject, MatDepth, int, bool) ...@@ -174,7 +174,19 @@ PARAM_TEST_CASE(CalcBackProject, MatDepth, int, bool)
OCL_OFF(calcBackProject(&frame1, 1, 0, hist1, dst1, &ranges1, 1, true)); OCL_OFF(calcBackProject(&frame1, 1, 0, hist1, dst1, &ranges1, 1, true));
OCL_ON(calcBackProject(uims, chs, uhist1, udst1, urngs, 1.0)); OCL_ON(calcBackProject(uims, chs, uhist1, udst1, urngs, 1.0));
EXPECT_MAT_NEAR(dst1, udst1, 0.0);
if (cv::ocl::useOpenCL() && cv::ocl::Device::getDefault().isAMD())
{
Size dstSize = dst1.size();
int nDiffs = (int)(0.03f*dstSize.height*dstSize.width);
//check if the dst mats are the same except 3% difference
EXPECT_MAT_N_DIFF(dst1, udst1, nDiffs);
}
else
{
EXPECT_MAT_NEAR(dst1, udst1, 0.0);
}
} }
}; };
...@@ -194,12 +206,15 @@ OCL_TEST_P(CalcBackProject, Mat) ...@@ -194,12 +206,15 @@ OCL_TEST_P(CalcBackProject, Mat)
//check if the dst mats are the same except 3% difference //check if the dst mats are the same except 3% difference
EXPECT_MAT_N_DIFF(dst_roi, udst_roi, nDiffs); EXPECT_MAT_N_DIFF(dst_roi, udst_roi, nDiffs);
//check in addition on given image
test_by_pict();
} }
} }
OCL_TEST_P(CalcBackProject, Mat_RealImage)
{
//check on given image
test_by_pict();
}
//////////////////////////////// CalcHist ////////////////////////////////////////////// //////////////////////////////// CalcHist //////////////////////////////////////////////
PARAM_TEST_CASE(CalcHist, bool) PARAM_TEST_CASE(CalcHist, bool)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment