Perf Tests: updates to cvtColor() & integral() perf tests
authorAndrey Pavlenko <no@email>
Wed, 7 Sep 2011 12:50:56 +0000 (12:50 +0000)
committerAndrey Pavlenko <no@email>
Wed, 7 Sep 2011 12:50:56 +0000 (12:50 +0000)
modules/imgproc/perf/perf_cvt_color.cpp
modules/imgproc/perf/perf_integral.cpp

index dc5fb4f..0e7ae27 100644 (file)
@@ -7,8 +7,9 @@ using namespace perf;
 CV_ENUM(CvtMode, CV_YUV2BGR, CV_YUV2RGB, //YUV
                  CV_YUV420i2BGR, CV_YUV420i2RGB, CV_YUV420sp2BGR, CV_YUV420sp2RGB, //YUV420
                  CV_RGB2GRAY, CV_RGBA2GRAY, CV_BGR2GRAY, CV_BGRA2GRAY, //Gray
-                 CV_GRAY2RGB, CV_GRAY2RGBA/*, CV_GRAY2BGR, CV_GRAY2BGRA*/ //Gray2
-                 )
+                 CV_GRAY2RGB, CV_GRAY2RGBA, /*CV_GRAY2BGR, CV_GRAY2BGRA*/ //Gray2
+                 CV_BGR2HSV, CV_RGB2HSV, CV_BGR2HLS, CV_RGB2HLS //H
+)
 
 typedef std::tr1::tuple<Size, CvtMode> Size_CvtMode_t;
 typedef perf::TestBaseWithParam<Size_CvtMode_t> Size_CvtMode;
@@ -109,3 +110,23 @@ PERF_TEST_P( Size_CvtMode, cvtColorGray2,
     SANITY_CHECK(dst);
 }
 
+PERF_TEST_P( Size_CvtMode, cvtColorH,
+    testing::Combine( 
+        testing::Values( TYPICAL_MAT_SIZES ), 
+        testing::Values( (int)CV_BGR2HSV, (int)CV_RGB2HSV, (int)CV_BGR2HLS, (int)CV_RGB2HLS )
+    )
+)
+{
+    Size sz = std::tr1::get<0>(GetParam());
+    int mode = std::tr1::get<1>(GetParam());
+
+    Mat src(sz, CV_8UC3);
+    Mat dst(sz, CV_8UC3);
+
+    declare.in(src, WARMUP_RNG).out(dst);
+    
+    TEST_CYCLE(100) { cvtColor(src, dst, mode);  }
+    
+    SANITY_CHECK(dst);
+}
+
index 0be744a..741b956 100644 (file)
@@ -1,44 +1,94 @@
-#include "perf_precomp.hpp"
-
-using namespace std;
-using namespace cv;
-using namespace perf;
-
-typedef std::tr1::tuple<Size, MatType, MatDepth> Size_MatType_OutMatDepth_t;
-typedef perf::TestBaseWithParam<Size_MatType_OutMatDepth_t> Size_MatType_OutMatDepth;
-
-/*
+#include "perf_precomp.hpp"\r
+\r
+using namespace std;\r
+using namespace cv;\r
+using namespace perf;\r
+\r
+typedef std::tr1::tuple<Size, MatType, MatDepth> Size_MatType_OutMatDepth_t;\r
+typedef perf::TestBaseWithParam<Size_MatType_OutMatDepth_t> Size_MatType_OutMatDepth;\r
+\r
+/*\r
 // void integral(InputArray image, OutputArray sum, int sdepth=-1 )\r
 */\r
-PERF_TEST_P( Size_MatType_OutMatDepth, integral1, 
-    testing::Combine(
-        testing::Values( TYPICAL_MAT_SIZES ), 
-        testing::Values( CV_8UC1, CV_8UC4 ),
-        testing::Values( CV_32S, CV_32F, CV_64F )
-    )
-    )
-{
-    Size sz = std::tr1::get<0>(GetParam());
-    int matType = std::tr1::get<1>(GetParam());
-    int sdepth = std::tr1::get<2>(GetParam());
-
-    Mat src(sz, matType);
-    Mat sum(sz, sdepth);
-
-    declare.in(src, WARMUP_RNG);
-    
-    TEST_CYCLE(100) { integral(src, sum, sdepth);  }
-    
-    SANITY_CHECK(sum);
-}
-\r
-\r
-\r
-/*
+PERF_TEST_P( Size_MatType_OutMatDepth, integral1, \r
+    testing::Combine(\r
+        testing::Values( TYPICAL_MAT_SIZES ), \r
+        testing::Values( CV_8UC1, CV_8UC4 ),\r
+        testing::Values( CV_32S, CV_32F, CV_64F )\r
+    )\r
+    )\r
+{\r
+    Size sz = std::tr1::get<0>(GetParam());\r
+    int matType = std::tr1::get<1>(GetParam());\r
+    int sdepth = std::tr1::get<2>(GetParam());\r
+\r
+    Mat src(sz, matType);\r
+    Mat sum(sz, sdepth);\r
+\r
+    declare.in(src, WARMUP_RNG).out(sum);\r
+    \r
+    TEST_CYCLE(100) { integral(src, sum, sdepth);  }\r
+    \r
+    SANITY_CHECK(sum);\r
+}\r
+\r
+\r
+\r
+/*\r
 // void integral(InputArray image, OutputArray sum, OutputArray sqsum, int sdepth=-1 )\r
 */\r
+PERF_TEST_P( Size_MatType_OutMatDepth, integral2, \r
+    testing::Combine(\r
+        testing::Values( TYPICAL_MAT_SIZES ), \r
+        testing::Values( CV_8UC1, CV_8UC4 ),\r
+        testing::Values( CV_32S, CV_32F, CV_64F )\r
+    )\r
+    )\r
+{\r
+    Size sz = std::tr1::get<0>(GetParam());\r
+    int matType = std::tr1::get<1>(GetParam());\r
+    int sdepth = std::tr1::get<2>(GetParam());\r
 \r
+    Mat src(sz, matType);\r
+    Mat sum(sz, sdepth);\r
+    Mat sqsum(sz, sdepth);\r
 \r
-/*
+    declare.in(src, WARMUP_RNG).out(sum, sqsum);\r
+    \r
+    TEST_CYCLE(100) { integral(src, sum, sqsum, sdepth);  }\r
+    \r
+    SANITY_CHECK(sum);\r
+    SANITY_CHECK(sqsum);\r
+}\r
+\r
+\r
+\r
+/*\r
 // void integral(InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 )\r
-*/
\ No newline at end of file
+*/\r
+PERF_TEST_P( Size_MatType_OutMatDepth, integral3, \r
+    testing::Combine(\r
+        testing::Values( TYPICAL_MAT_SIZES ), \r
+        testing::Values( CV_8UC1, CV_8UC4 ),\r
+        testing::Values( CV_32S, CV_32F, CV_64F )\r
+    )\r
+    )\r
+{\r
+    Size sz = std::tr1::get<0>(GetParam());\r
+    int matType = std::tr1::get<1>(GetParam());\r
+    int sdepth = std::tr1::get<2>(GetParam());\r
+\r
+    Mat src(sz, matType);\r
+    Mat sum(sz, sdepth);\r
+    Mat sqsum(sz, sdepth);\r
+    Mat tilted(sz, sdepth);\r
+\r
+    declare.in(src, WARMUP_RNG).out(sum, sqsum, tilted);\r
+    \r
+    TEST_CYCLE(100) { integral(src, sum, sqsum, sdepth);  }\r
+    \r
+    SANITY_CHECK(sum);\r
+    SANITY_CHECK(sqsum);\r
+    SANITY_CHECK(tilted);\r
+}\r
+\r