perf_grayworld.cpp 880 Bytes
Newer Older
1 2 3
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
4 5
#include "perf_precomp.hpp"

6
namespace opencv_test { namespace {
7

8
typedef tuple<Size, float> Size_WBThresh_t;
9 10 11 12
typedef perf::TestBaseWithParam<Size_WBThresh_t> Size_WBThresh;

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

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

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

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

    SANITY_CHECK(dst);
}

33 34

}} // namespace