Home | History | Annotate | Download | only in perf
      1 #include "perf_precomp.hpp"
      2 
      3 using namespace std;
      4 using namespace cv;
      5 using namespace perf;
      6 using namespace testing;
      7 using std::tr1::make_tuple;
      8 using std::tr1::get;
      9 
     10 CV_ENUM(Mat_Type, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3)
     11 
     12 typedef TestBaseWithParam< tr1::tuple<Size, int, Mat_Type> > TestBilateralFilter;
     13 
     14 PERF_TEST_P( TestBilateralFilter, BilateralFilter,
     15              Combine(
     16                 Values( szVGA, sz1080p ), // image size
     17                 Values( 3, 5 ), // d
     18                 Mat_Type::all() // image type
     19              )
     20 )
     21 {
     22     Size sz;
     23     int d, type;
     24     const double sigmaColor = 1., sigmaSpace = 1.;
     25 
     26     sz         = get<0>(GetParam());
     27     d          = get<1>(GetParam());
     28     type       = get<2>(GetParam());
     29 
     30     Mat src(sz, type);
     31     Mat dst(sz, type);
     32 
     33     declare.in(src, WARMUP_RNG).out(dst).time(20);
     34 
     35     TEST_CYCLE() bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, BORDER_DEFAULT);
     36 
     37     SANITY_CHECK(dst, .01, ERROR_RELATIVE);
     38 }
     39