pull/2609/head
Alexander Alekhin 11 years ago
parent f104d5be8c
commit 3a1a3da782
  1. 2
      modules/imgproc/test/ocl/test_color.cpp
  2. 25
      modules/imgproc/test/ocl/test_histogram.cpp

@ -158,7 +158,7 @@ OCL_TEST_P(CvtColor, YCrCb2BGRA) { performTest(3, 4, CVTCODE(YCrCb2BGR)); }
#if IPP_VERSION_X100 > 0
#define IPP_EPS depth <= CV_32S ? 1 : 4e-5
#else
#define IPP_EPS 0
#define IPP_EPS 1e-3
#endif
OCL_TEST_P(CvtColor, RGB2XYZ) { performTest(3, 3, CVTCODE(RGB2XYZ), IPP_EPS); }

@ -146,7 +146,7 @@ PARAM_TEST_CASE(CalcBackProject, MatDepth, int, bool)
scale = randomDouble(0.1, 1);
}
virtual void test_by_pict()
void test_by_pict()
{
Mat frame1 = readImage("optflow/RubberWhale1.png", IMREAD_GRAYSCALE);
@ -174,7 +174,19 @@ PARAM_TEST_CASE(CalcBackProject, MatDepth, int, bool)
OCL_OFF(calcBackProject(&frame1, 1, 0, hist1, dst1, &ranges1, 1, true));
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)
//check if the dst mats are the same except 3% difference
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 //////////////////////////////////////////////
PARAM_TEST_CASE(CalcHist, bool)

Loading…
Cancel
Save