Commit 8176e893 authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #2609 from alalek:tests_fixes

parents 5ff59af0 3a1a3da7
...@@ -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,8 +174,20 @@ PARAM_TEST_CASE(CalcBackProject, MatDepth, int, bool) ...@@ -174,8 +174,20 @@ 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));
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); EXPECT_MAT_NEAR(dst1, udst1, 0.0);
} }
}
}; };
//////////////////////////////// CalcBackProject ////////////////////////////////////////////// //////////////////////////////// CalcBackProject //////////////////////////////////////////////
...@@ -194,10 +206,13 @@ OCL_TEST_P(CalcBackProject, Mat) ...@@ -194,10 +206,13 @@ 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 OCL_TEST_P(CalcBackProject, Mat_RealImage)
{
//check on given image
test_by_pict(); test_by_pict();
}
} }
//////////////////////////////// CalcHist ////////////////////////////////////////////// //////////////////////////////// CalcHist //////////////////////////////////////////////
......
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