perf_grayworld.cpp 726 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
#include "perf_precomp.hpp"

using namespace std;
using namespace cv;
using namespace perf;

typedef std::tr1::tuple<Size, float> Size_WBThresh_t;
typedef perf::TestBaseWithParam<Size_WBThresh_t> Size_WBThresh;

PERF_TEST_P( Size_WBThresh, autowbGrayworld,
    testing::Combine(
12
        SZ_ALL_HD,
13 14 15 16 17 18 19 20 21 22 23
        testing::Values( 0.1, 0.5, 1.0 )
    )
)
{
    Size size = std::tr1::get<0>(GetParam());
    float wb_thresh = std::tr1::get<1>(GetParam());

    Mat src(size, CV_8UC3);
    Mat dst(size, CV_8UC3);

    declare.in(src, WARMUP_RNG).out(dst);
24 25
    Ptr<xphoto::GrayworldWB> wb = xphoto::createGrayworldWB();
    wb->setSaturationThreshold(wb_thresh);
26

27
    TEST_CYCLE() wb->balanceWhite(src, dst);
28 29 30 31

    SANITY_CHECK(dst);
}