Merge pull request #1751 from ilya-lavrenov:ocl_copyMakeBorder_test_fix

This commit is contained in:
Andrey Pavlenko 2013-11-05 23:49:11 +04:00 committed by OpenCV Buildbot
commit 14c3560750

View File

@ -142,18 +142,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)
@ -567,14 +572,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