Skip to content

Commit f78f908

Browse files
committed
Merge pull request opencv#17674 from alalek:issue_16214
2 parents 5487bca + 762a5c8 commit f78f908

File tree

9 files changed

+362
-112
lines changed

9 files changed

+362
-112
lines changed

modules/imgproc/perf/opencl/perf_filters.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,62 @@ OCL_PERF_TEST_P(Filter2DFixture, Filter2D,
313313
SANITY_CHECK(dst, eps);
314314
}
315315

316+
///////////// SepFilter2D /////////////
317+
318+
typedef FilterFixture OCL_SepFilter2D;
319+
320+
PERF_TEST_P_(OCL_SepFilter2D, SepFilter2D)
321+
{
322+
const FilterParams& params = GetParam();
323+
const Size srcSize = get<0>(params);
324+
const int type = get<1>(params), ksize = get<2>(params);
325+
326+
checkDeviceMaxMemoryAllocSize(srcSize, type);
327+
328+
UMat src(srcSize, type), dst(srcSize, type);
329+
declare.in(src, WARMUP_RNG).out(dst);
330+
331+
Mat kernelX(1, ksize, CV_32FC1);
332+
randu(kernelX, -3.0, 3.0);
333+
Mat kernelY(1, ksize, CV_32FC1);
334+
randu(kernelY, -3.0, 3.0);
335+
336+
OCL_TEST_CYCLE() cv::sepFilter2D(src, dst, -1, kernelX, kernelY, cv::Point(-1, -1), 1.0f, cv::BORDER_CONSTANT);
337+
338+
SANITY_CHECK_NOTHING();
339+
}
340+
341+
PERF_TEST_P_(OCL_SepFilter2D, SepFilter2D_BitExact)
342+
{
343+
const FilterParams& params = GetParam();
344+
const Size srcSize = get<0>(params);
345+
const int type = get<1>(params), ksize = get<2>(params);
346+
347+
checkDeviceMaxMemoryAllocSize(srcSize, type);
348+
349+
UMat src(srcSize, type), dst(srcSize, type);
350+
declare.in(src, WARMUP_RNG).out(dst);
351+
352+
Mat kernelX(1, ksize, CV_32SC1);
353+
randu(kernelX, -16.0, 16.0);
354+
kernelX.convertTo(kernelX, CV_32FC1, 1/16.0f, 0);
355+
Mat kernelY(1, ksize, CV_32SC1);
356+
randu(kernelY, -16.0, 16.0);
357+
kernelY.convertTo(kernelY, CV_32FC1, 1/16.0f, 0);
358+
359+
OCL_TEST_CYCLE() cv::sepFilter2D(src, dst, -1, kernelX, kernelY, cv::Point(-1, -1), 1.0f, cv::BORDER_CONSTANT);
360+
361+
SANITY_CHECK_NOTHING();
362+
}
363+
364+
INSTANTIATE_TEST_CASE_P(/*nothing*/, OCL_SepFilter2D,
365+
::testing::Combine(
366+
::testing::Values(sz1080p),
367+
OCL_TEST_TYPES,
368+
OCL_PERF_ENUM(3, 5, 7, 9, 11)
369+
)
370+
);
371+
316372
///////////// Bilateral ////////////////////////
317373

318374
typedef TestBaseWithParam<Size> BilateralFixture;

0 commit comments

Comments
 (0)