1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge pull request #2812 from arkunze:pullreq/140520-filter2D

This commit is contained in:
Alexander Alekhin
2014-06-04 12:20:54 +04:00
committed by OpenCV Buildbot
3 changed files with 36 additions and 17 deletions
+6 -7
View File
@@ -57,7 +57,7 @@ PARAM_TEST_CASE(Filter2D, MatDepth, Channels, int, int, BorderType, bool, bool)
static const int kernelMaxSize = 10;
int type;
Size dsize;
Size size;
Point anchor;
int borderType;
int widthMultiple;
@@ -81,17 +81,16 @@ PARAM_TEST_CASE(Filter2D, MatDepth, Channels, int, int, BorderType, bool, bool)
void random_roi()
{
dsize = randomSize(1, MAX_VALUE);
size = randomSize(1, MAX_VALUE);
// Make sure the width is a multiple of the requested value, and no more.
dsize.width &= ~((widthMultiple * 2) - 1);
dsize.width += widthMultiple;
size.width &= ~((widthMultiple * 2) - 1);
size.width += widthMultiple;
Size roiSize = randomSize(kernel.size[0], MAX_VALUE, kernel.size[1], MAX_VALUE);
Border srcBorder = randomBorder(0, useRoi ? MAX_VALUE : 0);
randomSubMat(src, src_roi, roiSize, srcBorder, type, -MAX_VALUE, MAX_VALUE);
randomSubMat(src, src_roi, size, srcBorder, type, -MAX_VALUE, MAX_VALUE);
Border dstBorder = randomBorder(0, useRoi ? MAX_VALUE : 0);
randomSubMat(dst, dst_roi, dsize, dstBorder, type, -MAX_VALUE, MAX_VALUE);
randomSubMat(dst, dst_roi, size, dstBorder, type, -MAX_VALUE, MAX_VALUE);
anchor.x = randomInt(-1, kernel.size[0]);
anchor.y = randomInt(-1, kernel.size[1]);