From: Anatoly Baksheev Date: Mon, 8 Oct 2012 09:58:03 +0000 (+0400) Subject: added MatCn enum to GPU perf tests X-Git-Tag: accepted/2.0/20130307.220821~364^2~109 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5b31c46c4f87a48501e8974873816e6c20085ac3;p=profile%2Fivi%2Fopencv.git added MatCn enum to GPU perf tests --- diff --git a/modules/gpu/perf/perf_core.cpp b/modules/gpu/perf/perf_core.cpp index 915a9a2..ffbb669 100644 --- a/modules/gpu/perf/perf_core.cpp +++ b/modules/gpu/perf/perf_core.cpp @@ -1456,7 +1456,7 @@ enum {FLIP_BOTH = 0, FLIP_X = 1, FLIP_Y = -1}; CV_ENUM(FlipCode, FLIP_BOTH, FLIP_X, FLIP_Y) #define ALL_FLIP_CODES ValuesIn(FlipCode::all()) -DEF_PARAM_TEST(Sz_Depth_Cn_Code, cv::Size, MatDepth, int, FlipCode); +DEF_PARAM_TEST(Sz_Depth_Cn_Code, cv::Size, MatDepth, MatCn, FlipCode); PERF_TEST_P(Sz_Depth_Cn_Code, Core_Flip, Combine( GPU_TYPICAL_MAT_SIZES, @@ -2204,7 +2204,7 @@ enum {Rows = 0, Cols = 1}; CV_ENUM(ReduceDim, Rows, Cols) #define ALL_REDUCE_DIMS ValuesIn(ReduceDim::all()) -DEF_PARAM_TEST(Sz_Depth_Cn_Code_Dim, cv::Size, MatDepth, int, ReduceCode, ReduceDim); +DEF_PARAM_TEST(Sz_Depth_Cn_Code_Dim, cv::Size, MatDepth, MatCn, ReduceCode, ReduceDim); PERF_TEST_P(Sz_Depth_Cn_Code_Dim, Core_Reduce, Combine( GPU_TYPICAL_MAT_SIZES, diff --git a/modules/gpu/perf/perf_denoising.cpp b/modules/gpu/perf/perf_denoising.cpp index ba3dd07..46fc8c5 100644 --- a/modules/gpu/perf/perf_denoising.cpp +++ b/modules/gpu/perf/perf_denoising.cpp @@ -9,10 +9,10 @@ using namespace testing; ////////////////////////////////////////////////////////////////////// // BilateralFilter -DEF_PARAM_TEST(Sz_Depth_Cn_KernelSz, cv::Size, MatDepth, int, int); +DEF_PARAM_TEST(Sz_Depth_Cn_KernelSz, cv::Size, MatDepth, MatCn, int); PERF_TEST_P(Sz_Depth_Cn_KernelSz, Denoising_BilateralFilter, - Combine(GPU_DENOISING_IMAGE_SIZES, Values(CV_8U, CV_32F), testing::Values(1, 3), Values(3, 5, 9))) + Combine(GPU_DENOISING_IMAGE_SIZES, Values(CV_8U, CV_32F), GPU_CHANNELS_1_3, Values(3, 5, 9))) { declare.time(60.0); @@ -59,10 +59,10 @@ PERF_TEST_P(Sz_Depth_Cn_KernelSz, Denoising_BilateralFilter, ////////////////////////////////////////////////////////////////////// // nonLocalMeans -DEF_PARAM_TEST(Sz_Depth_Cn_WinSz_BlockSz, cv::Size, MatDepth, int, int, int); +DEF_PARAM_TEST(Sz_Depth_Cn_WinSz_BlockSz, cv::Size, MatDepth, MatCn, int, int); PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_NonLocalMeans, - Combine(GPU_DENOISING_IMAGE_SIZES, Values(CV_8U), Values(1, 3), Values(21), Values(5, 7))) + Combine(GPU_DENOISING_IMAGE_SIZES, Values(CV_8U), GPU_CHANNELS_1_3, Values(21), Values(5, 7))) { declare.time(60.0); @@ -103,10 +103,10 @@ PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_NonLocalMeans, ////////////////////////////////////////////////////////////////////// // fastNonLocalMeans -DEF_PARAM_TEST(Sz_Depth_WinSz_BlockSz, cv::Size, MatDepth, int, int); +DEF_PARAM_TEST(Sz_Depth_Cn_WinSz_BlockSz, cv::Size, MatDepth, MatCn, int, int); -PERF_TEST_P(Sz_Depth_WinSz_BlockSz, Denoising_FastNonLocalMeans, - Combine(GPU_DENOISING_IMAGE_SIZES, Values(CV_8U), Values(21), Values(7))) +PERF_TEST_P(Sz_Depth_Cn_WinSz_BlockSz, Denoising_FastNonLocalMeans, + Combine(GPU_DENOISING_IMAGE_SIZES, Values(CV_8U), GPU_CHANNELS_1_3, Values(21), Values(7))) { declare.time(150.0); @@ -150,6 +150,7 @@ PERF_TEST_P(Sz_Depth_WinSz_BlockSz, Denoising_FastNonLocalMeans, ////////////////////////////////////////////////////////////////////// // fastNonLocalMeans (colored) +DEF_PARAM_TEST(Sz_Depth_WinSz_BlockSz, cv::Size, MatDepth, int, int); PERF_TEST_P(Sz_Depth_WinSz_BlockSz, Denoising_FastNonLocalMeansColored, Combine(GPU_DENOISING_IMAGE_SIZES, Values(CV_8U), Values(21), Values(7))) diff --git a/modules/gpu/perf/perf_imgproc.cpp b/modules/gpu/perf/perf_imgproc.cpp index 14fd71a..6bb6d99 100644 --- a/modules/gpu/perf/perf_imgproc.cpp +++ b/modules/gpu/perf/perf_imgproc.cpp @@ -49,7 +49,7 @@ void generateMap(cv::Mat& map_x, cv::Mat& map_y, int remapMode) } } -DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Border_Mode, cv::Size, MatDepth, int, Interpolation, BorderMode, RemapMode); +DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Border_Mode, cv::Size, MatDepth, MatCn, Interpolation, BorderMode, RemapMode); PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, ImgProc_Remap, Combine( GPU_TYPICAL_MAT_SIZES, @@ -108,7 +108,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border_Mode, ImgProc_Remap, Combine( ////////////////////////////////////////////////////////////////////// // Resize -DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Scale, cv::Size, MatDepth, int, Interpolation, double); +DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Scale, cv::Size, MatDepth, MatCn, Interpolation, double); PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, ImgProc_Resize, Combine( GPU_TYPICAL_MAT_SIZES, @@ -158,7 +158,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, ImgProc_Resize, Combine( ////////////////////////////////////////////////////////////////////// // ResizeArea -DEF_PARAM_TEST(Sz_Depth_Cn_Scale, cv::Size, MatDepth, int, double); +DEF_PARAM_TEST(Sz_Depth_Cn_Scale, cv::Size, MatDepth, MatCn, double); PERF_TEST_P(Sz_Depth_Cn_Scale, ImgProc_ResizeArea, Combine( GPU_TYPICAL_MAT_SIZES, @@ -207,7 +207,7 @@ PERF_TEST_P(Sz_Depth_Cn_Scale, ImgProc_ResizeArea, Combine( ////////////////////////////////////////////////////////////////////// // WarpAffine -DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Border, cv::Size, MatDepth, int, Interpolation, BorderMode); +DEF_PARAM_TEST(Sz_Depth_Cn_Inter_Border, cv::Size, MatDepth, MatCn, Interpolation, BorderMode); PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpAffine, Combine( GPU_TYPICAL_MAT_SIZES, @@ -316,7 +316,7 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Border, ImgProc_WarpPerspective, Combine( ////////////////////////////////////////////////////////////////////// // CopyMakeBorder -DEF_PARAM_TEST(Sz_Depth_Cn_Border, cv::Size, MatDepth, int, BorderMode); +DEF_PARAM_TEST(Sz_Depth_Cn_Border, cv::Size, MatDepth, MatCn, BorderMode); PERF_TEST_P(Sz_Depth_Cn_Border, ImgProc_CopyMakeBorder, Combine( GPU_TYPICAL_MAT_SIZES, @@ -882,7 +882,7 @@ PERF_TEST_P(Sz_KernelSz_Ccorr, ImgProc_Convolve, Combine(GPU_TYPICAL_MAT_SIZES, CV_ENUM(TemplateMethod, cv::TM_SQDIFF, cv::TM_SQDIFF_NORMED, cv::TM_CCORR, cv::TM_CCORR_NORMED, cv::TM_CCOEFF, cv::TM_CCOEFF_NORMED) #define ALL_TEMPLATE_METHODS ValuesIn(TemplateMethod::all()) -DEF_PARAM_TEST(Sz_TemplateSz_Cn_Method, cv::Size, cv::Size, int, TemplateMethod); +DEF_PARAM_TEST(Sz_TemplateSz_Cn_Method, cv::Size, cv::Size, MatCn, TemplateMethod); PERF_TEST_P(Sz_TemplateSz_Cn_Method, ImgProc_MatchTemplate8U, Combine( GPU_TYPICAL_MAT_SIZES, @@ -1282,7 +1282,7 @@ PERF_TEST_P(Sz, ImgProc_BuildWarpSphericalMaps, GPU_TYPICAL_MAT_SIZES) ////////////////////////////////////////////////////////////////////// // Rotate -DEF_PARAM_TEST(Sz_Depth_Cn_Inter, cv::Size, MatDepth, int, Interpolation); +DEF_PARAM_TEST(Sz_Depth_Cn_Inter, cv::Size, MatDepth, MatCn, Interpolation); PERF_TEST_P(Sz_Depth_Cn_Inter, ImgProc_Rotate, Combine( GPU_TYPICAL_MAT_SIZES, diff --git a/modules/gpu/perf/perf_video.cpp b/modules/gpu/perf/perf_video.cpp index 286222d..0d58e84 100644 --- a/modules/gpu/perf/perf_video.cpp +++ b/modules/gpu/perf/perf_video.cpp @@ -421,7 +421,7 @@ PERF_TEST_P(Video, Video_FGDStatModel, Values("gpu/video/768x576.avi", "gpu/vide ////////////////////////////////////////////////////// // MOG -DEF_PARAM_TEST(Video_Cn_LearningRate, string, int, double); +DEF_PARAM_TEST(Video_Cn_LearningRate, string, MatCn, double); PERF_TEST_P(Video_Cn_LearningRate, Video_MOG, Combine(Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"), GPU_CHANNELS_1_3_4, Values(0.0, 0.01))) { @@ -737,7 +737,7 @@ PERF_TEST_P(Video_Cn, Video_VIBE, Combine(Values("gpu/video/768x576.avi", "gpu/v ////////////////////////////////////////////////////// // GMG -DEF_PARAM_TEST(Video_Cn_MaxFeatures, string, int, int); +DEF_PARAM_TEST(Video_Cn_MaxFeatures, string, MatCn, int); PERF_TEST_P(Video_Cn_MaxFeatures, Video_GMG, Combine(Values("gpu/video/768x576.avi", "gpu/video/1920x1080.avi"), GPU_CHANNELS_1_3_4, Values(20, 40, 60))) { diff --git a/modules/gpu/perf/utility.hpp b/modules/gpu/perf/utility.hpp index d2e3a07..b40d55e 100644 --- a/modules/gpu/perf/utility.hpp +++ b/modules/gpu/perf/utility.hpp @@ -20,6 +20,11 @@ CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC, cv: #define ALL_INTERPOLATIONS testing::ValuesIn(Interpolation::all()) CV_ENUM(NormType, cv::NORM_INF, cv::NORM_L1, cv::NORM_L2, cv::NORM_HAMMING) +enum { Gray = 1, TwoChannel = 2, BGR = 3, BGRA = 4 }; +CV_ENUM(MatCn, Gray, TwoChannel, BGR, BGRA) +#define GPU_CHANNELS_1_3_4 testing::Values(Gray, BGR, BGRA) +#define GPU_CHANNELS_1_3 testing::Values(Gray, BGR) + struct CvtColorInfo { int scn; @@ -41,6 +46,6 @@ DEF_PARAM_TEST(Sz_Depth, cv::Size, MatDepth); DEF_PARAM_TEST(Sz_Depth_Cn, cv::Size, MatDepth, int); #define GPU_TYPICAL_MAT_SIZES testing::Values(perf::sz720p, perf::szSXGA, perf::sz1080p) -#define GPU_CHANNELS_1_3_4 testing::Values(1, 3, 4) + #endif // __OPENCV_PERF_GPU_UTILITY_HPP__