2017-11-05 21:48:40 +08:00
|
|
|
// 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.
|
2017-04-14 18:35:07 +08:00
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
|
2017-11-05 21:48:40 +08:00
|
|
|
namespace opencv_test {
|
2017-04-14 18:35:07 +08:00
|
|
|
|
|
|
|
#ifdef HAVE_OPENVX
|
|
|
|
PERF_TEST_P(Size_MatType, Accumulate,
|
|
|
|
testing::Combine(
|
|
|
|
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p),
|
|
|
|
testing::Values(CV_16SC1, CV_32FC1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#else
|
|
|
|
PERF_TEST_P( Size_MatType, Accumulate,
|
|
|
|
testing::Combine(
|
|
|
|
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p),
|
|
|
|
testing::Values(CV_32FC1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
Size sz = get<0>(GetParam());
|
|
|
|
int dstType = get<1>(GetParam());
|
|
|
|
|
|
|
|
Mat src(sz, CV_8UC1);
|
|
|
|
Mat dst(sz, dstType);
|
|
|
|
|
|
|
|
declare.time(100);
|
|
|
|
declare.in(src, WARMUP_RNG).out(dst);
|
|
|
|
|
2017-05-29 21:47:41 +08:00
|
|
|
TEST_CYCLE() accumulate(src, dst);
|
2017-04-14 18:35:07 +08:00
|
|
|
|
2017-05-29 21:47:41 +08:00
|
|
|
SANITY_CHECK_NOTHING();
|
2017-04-14 18:35:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENVX
|
|
|
|
PERF_TEST_P(Size_MatType, AccumulateSquare,
|
|
|
|
testing::Combine(
|
|
|
|
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p),
|
|
|
|
testing::Values(CV_16SC1, CV_32FC1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#else
|
|
|
|
PERF_TEST_P( Size_MatType, AccumulateSquare,
|
|
|
|
testing::Combine(
|
|
|
|
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p),
|
|
|
|
testing::Values(CV_32FC1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
Size sz = get<0>(GetParam());
|
|
|
|
int dstType = get<1>(GetParam());
|
|
|
|
|
|
|
|
Mat src(sz, CV_8UC1);
|
|
|
|
Mat dst(sz, dstType);
|
|
|
|
|
|
|
|
declare.time(100);
|
|
|
|
declare.in(src, WARMUP_RNG).out(dst);
|
|
|
|
|
2017-05-29 21:47:41 +08:00
|
|
|
TEST_CYCLE() accumulateSquare(src, dst);
|
2017-04-14 18:35:07 +08:00
|
|
|
|
2017-05-29 21:47:41 +08:00
|
|
|
SANITY_CHECK_NOTHING();
|
2017-04-14 18:35:07 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENVX
|
|
|
|
PERF_TEST_P(Size_MatType, AccumulateWeighted,
|
|
|
|
testing::Combine(
|
|
|
|
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p),
|
|
|
|
testing::Values(CV_8UC1, CV_32FC1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#else
|
|
|
|
PERF_TEST_P( Size_MatType, AccumulateWeighted,
|
|
|
|
testing::Combine(
|
|
|
|
testing::Values(::perf::szODD, ::perf::szQVGA, ::perf::szVGA, ::perf::sz1080p),
|
|
|
|
testing::Values(CV_32FC1)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
Size sz = get<0>(GetParam());
|
|
|
|
int dstType = get<1>(GetParam());
|
|
|
|
|
|
|
|
Mat src(sz, CV_8UC1);
|
|
|
|
Mat dst(sz, dstType);
|
|
|
|
|
|
|
|
declare.time(100);
|
|
|
|
declare.in(src, WARMUP_RNG).out(dst);
|
|
|
|
|
2017-05-29 21:47:41 +08:00
|
|
|
TEST_CYCLE() accumulateWeighted(src, dst, 0.314);
|
2017-04-14 18:35:07 +08:00
|
|
|
|
2017-05-29 21:47:41 +08:00
|
|
|
SANITY_CHECK_NOTHING();
|
2017-04-14 18:35:07 +08:00
|
|
|
}
|
2017-11-05 21:48:40 +08:00
|
|
|
|
|
|
|
} // namespace
|