1 #include "perf_precomp.hpp"
4 using namespace testing;
7 //////////////////////////////////////////////////////////////////////
10 DEF_PARAM_TEST(Sz_Depth_Cn_KernelSz, cv::Size, MatDepth , int, int);
12 PERF_TEST_P(Sz_Depth_Cn_KernelSz, Denoising_BilateralFilter,
13 Combine(GPU_TYPICAL_MAT_SIZES, Values(CV_8U, CV_16U, CV_32F), GPU_CHANNELS_1_3_4, Values(3, 5, 9)))
17 cv::Size size = GET_PARAM(0);
18 int depth = GET_PARAM(1);
19 int channels = GET_PARAM(2);
20 int kernel_size = GET_PARAM(3);
22 float sigma_color = 7;
23 float sigma_spatial = 5;
24 int borderMode = cv::BORDER_REFLECT101;
26 int type = CV_MAKE_TYPE(depth, channels);
28 cv::Mat src(size, type);
33 cv::gpu::GpuMat d_src(src);
34 cv::gpu::GpuMat d_dst;
36 cv::gpu::bilateralFilter(d_src, d_dst, kernel_size, sigma_color, sigma_spatial, borderMode);
40 cv::gpu::bilateralFilter(d_src, d_dst, kernel_size, sigma_color, sigma_spatial, borderMode);
47 cv::bilateralFilter(src, dst, kernel_size, sigma_color, sigma_spatial, borderMode);
51 cv::bilateralFilter(src, dst, kernel_size, sigma_color, sigma_spatial, borderMode);
57 //////////////////////////////////////////////////////////////////////
60 DEF_PARAM_TEST(Sz_Depth_Cn_WinSz_BlockSz, cv::Size, MatDepth , int, int, int);
62 PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_NonLocalMeans,
63 Combine(GPU_TYPICAL_MAT_SIZES, Values<MatDepth>(CV_8U), Values(1), Values(21), Values(5, 7)))
67 cv::Size size = GET_PARAM(0);
68 int depth = GET_PARAM(1);
69 int channels = GET_PARAM(2);
71 int search_widow_size = GET_PARAM(3);
72 int block_size = GET_PARAM(4);
75 int borderMode = cv::BORDER_REFLECT101;
77 int type = CV_MAKE_TYPE(depth, channels);
79 cv::Mat src(size, type);
84 cv::gpu::GpuMat d_src(src);
85 cv::gpu::GpuMat d_dst;
87 cv::gpu::nonLocalMeans(d_src, d_dst, h, search_widow_size, block_size, borderMode);
91 cv::gpu::nonLocalMeans(d_src, d_dst, h, search_widow_size, block_size, borderMode);