From e544e34eed67a692338018b5e281f8466c04e8b1 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 1 Nov 2013 19:06:42 +0400 Subject: [PATCH] fixed ocl::copyMakeBorder accuracy test --- modules/ocl/test/test_imgproc.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/ocl/test/test_imgproc.cpp b/modules/ocl/test/test_imgproc.cpp index e981d437e8..ab25e508e1 100644 --- a/modules/ocl/test/test_imgproc.cpp +++ b/modules/ocl/test/test_imgproc.cpp @@ -134,18 +134,23 @@ PARAM_TEST_CASE(CopyMakeBorder, MatDepth, // depth void random_roi() { + border = randomBorder(0, MAX_VALUE << 2); + val = randomScalar(-MAX_VALUE, MAX_VALUE); + Size roiSize = randomSize(1, MAX_VALUE); Border srcBorder = randomBorder(0, useRoi ? MAX_VALUE : 0); - randomSubMat(src, src_roi, roiSize, srcBorder, type, 5, 256); + randomSubMat(src, src_roi, roiSize, srcBorder, type, -MAX_VALUE, MAX_VALUE); Border dstBorder = randomBorder(0, useRoi ? MAX_VALUE : 0); - randomSubMat(dst_whole, dst_roi, roiSize, dstBorder, type, 5, 16); + dstBorder.top += border.top; + dstBorder.lef += border.lef; + dstBorder.rig += border.rig; + dstBorder.bot += border.bot; + + randomSubMat(dst_whole, dst_roi, roiSize, dstBorder, type, -MAX_VALUE, MAX_VALUE); generateOclMat(gsrc_whole, gsrc_roi, src, roiSize, srcBorder); generateOclMat(gdst_whole, gdst_roi, dst_whole, roiSize, dstBorder); - - border = randomBorder(0, MAX_VALUE << 2); - val = randomScalar(-MAX_VALUE, MAX_VALUE); } void Near(double threshold = 0.0) @@ -559,14 +564,11 @@ INSTANTIATE_TEST_CASE_P(Imgproc, ColumnSum, Combine( Bool())); INSTANTIATE_TEST_CASE_P(ImgprocTestBase, CopyMakeBorder, Combine( - testing::Range((MatDepth)CV_8U, (MatDepth)CV_USRTYPE1), - testing::Values((Channels)1, (Channels)4), + testing::Values((MatDepth)CV_8U, (MatDepth)CV_16S, (MatDepth)CV_32S, (MatDepth)CV_32F), + testing::Values(Channels(1), Channels(3), (Channels)4), Bool(), // border isolated or not - Values((Border)BORDER_CONSTANT, - (Border)BORDER_REPLICATE, - (Border)BORDER_REFLECT, - (Border)BORDER_WRAP, - (Border)BORDER_REFLECT_101), + Values((Border)BORDER_REPLICATE, (Border)BORDER_REFLECT, + (Border)BORDER_WRAP, (Border)BORDER_REFLECT_101), Bool())); #endif // HAVE_OPENCL