Commit b58b04a3 authored by Andrey Pavlenko's avatar Andrey Pavlenko

Perf Tests: updates to cvtColor() & integral() perf tests

parent cbb6ac0c
...@@ -7,8 +7,9 @@ using namespace perf; ...@@ -7,8 +7,9 @@ using namespace perf;
CV_ENUM(CvtMode, CV_YUV2BGR, CV_YUV2RGB, //YUV CV_ENUM(CvtMode, CV_YUV2BGR, CV_YUV2RGB, //YUV
CV_YUV420i2BGR, CV_YUV420i2RGB, CV_YUV420sp2BGR, CV_YUV420sp2RGB, //YUV420 CV_YUV420i2BGR, CV_YUV420i2RGB, CV_YUV420sp2BGR, CV_YUV420sp2RGB, //YUV420
CV_RGB2GRAY, CV_RGBA2GRAY, CV_BGR2GRAY, CV_BGRA2GRAY, //Gray 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 std::tr1::tuple<Size, CvtMode> Size_CvtMode_t;
typedef perf::TestBaseWithParam<Size_CvtMode_t> Size_CvtMode; typedef perf::TestBaseWithParam<Size_CvtMode_t> Size_CvtMode;
...@@ -109,3 +110,23 @@ PERF_TEST_P( Size_CvtMode, cvtColorGray2, ...@@ -109,3 +110,23 @@ PERF_TEST_P( Size_CvtMode, cvtColorGray2,
SANITY_CHECK(dst); 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);
}
#include "perf_precomp.hpp" #include "perf_precomp.hpp"
using namespace std; using namespace std;
using namespace cv; using namespace cv;
using namespace perf; using namespace perf;
typedef std::tr1::tuple<Size, MatType, MatDepth> Size_MatType_OutMatDepth_t; typedef std::tr1::tuple<Size, MatType, MatDepth> Size_MatType_OutMatDepth_t;
typedef perf::TestBaseWithParam<Size_MatType_OutMatDepth_t> Size_MatType_OutMatDepth; typedef perf::TestBaseWithParam<Size_MatType_OutMatDepth_t> Size_MatType_OutMatDepth;
/* /*
// void integral(InputArray image, OutputArray sum, int sdepth=-1 ) // void integral(InputArray image, OutputArray sum, int sdepth=-1 )
*/ */
PERF_TEST_P( Size_MatType_OutMatDepth, integral1, PERF_TEST_P( Size_MatType_OutMatDepth, integral1,
testing::Combine( testing::Combine(
testing::Values( TYPICAL_MAT_SIZES ), testing::Values( TYPICAL_MAT_SIZES ),
testing::Values( CV_8UC1, CV_8UC4 ), testing::Values( CV_8UC1, CV_8UC4 ),
testing::Values( CV_32S, CV_32F, CV_64F ) testing::Values( CV_32S, CV_32F, CV_64F )
) )
) )
{ {
Size sz = std::tr1::get<0>(GetParam()); Size sz = std::tr1::get<0>(GetParam());
int matType = std::tr1::get<1>(GetParam()); int matType = std::tr1::get<1>(GetParam());
int sdepth = std::tr1::get<2>(GetParam()); int sdepth = std::tr1::get<2>(GetParam());
Mat src(sz, matType); Mat src(sz, matType);
Mat sum(sz, sdepth); Mat sum(sz, sdepth);
declare.in(src, WARMUP_RNG); declare.in(src, WARMUP_RNG).out(sum);
TEST_CYCLE(100) { integral(src, sum, sdepth); } TEST_CYCLE(100) { integral(src, sum, sdepth); }
SANITY_CHECK(sum); SANITY_CHECK(sum);
} }
/* /*
// void integral(InputArray image, OutputArray sum, OutputArray sqsum, int sdepth=-1 ) // void integral(InputArray image, OutputArray sum, OutputArray sqsum, int sdepth=-1 )
*/ */
PERF_TEST_P( Size_MatType_OutMatDepth, integral2,
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);
Mat sqsum(sz, sdepth);
/* declare.in(src, WARMUP_RNG).out(sum, sqsum);
TEST_CYCLE(100) { integral(src, sum, sqsum, sdepth); }
SANITY_CHECK(sum);
SANITY_CHECK(sqsum);
}
/*
// void integral(InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 ) // void integral(InputArray image, OutputArray sum, OutputArray sqsum, OutputArray tilted, int sdepth=-1 )
*/ */
\ No newline at end of file PERF_TEST_P( Size_MatType_OutMatDepth, integral3,
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);
Mat sqsum(sz, sdepth);
Mat tilted(sz, sdepth);
declare.in(src, WARMUP_RNG).out(sum, sqsum, tilted);
TEST_CYCLE(100) { integral(src, sum, sqsum, sdepth); }
SANITY_CHECK(sum);
SANITY_CHECK(sqsum);
SANITY_CHECK(tilted);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment