mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
Merge branch 4.x
This commit is contained in:
@@ -706,6 +706,28 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , ArithmMixedTest,
|
||||
)
|
||||
);
|
||||
|
||||
typedef perf::TestBaseWithParam<std::tuple<cv::Size, int, bool>> SqrtFixture;
|
||||
PERF_TEST_P_(SqrtFixture, Sqrt) {
|
||||
Size sz = get<0>(GetParam());
|
||||
int type = get<1>(GetParam());
|
||||
bool inverse = get<2>(GetParam());
|
||||
|
||||
Mat src(sz, type), dst(sz, type);
|
||||
randu(src, FLT_EPSILON, 1000);
|
||||
declare.in(src).out(dst);
|
||||
|
||||
TEST_CYCLE() cv::pow(src, inverse ? -0.5 : 0.5, dst);
|
||||
|
||||
SANITY_CHECK_NOTHING();
|
||||
}
|
||||
INSTANTIATE_TEST_CASE_P(/*nothing*/ , SqrtFixture,
|
||||
testing::Combine(
|
||||
testing::Values(TYPICAL_MAT_SIZES),
|
||||
testing::Values(CV_32FC1, CV_64FC1),
|
||||
testing::Bool()
|
||||
)
|
||||
);
|
||||
|
||||
///////////// Rotate ////////////////////////
|
||||
|
||||
typedef perf::TestBaseWithParam<std::tuple<cv::Size, int, perf::MatType>> RotateTest;
|
||||
@@ -862,5 +884,29 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , FiniteMaskFixture,
|
||||
)
|
||||
);
|
||||
|
||||
//////////////EXP////////////
|
||||
|
||||
typedef Size_MatType ExpFixture;
|
||||
|
||||
PERF_TEST_P(ExpFixture, Exp,
|
||||
testing::Combine(testing::Values(TYPICAL_MAT_SIZES), testing::Values(CV_32F, CV_64F)))
|
||||
{
|
||||
cv::Size size = std::get<0>(GetParam());
|
||||
int type = std::get<1>(GetParam());
|
||||
|
||||
cv::Mat src(size, type);
|
||||
cv::Mat dst(size, type);
|
||||
|
||||
declare.in(src).out(dst);
|
||||
|
||||
cv::randu(src, -5.0, 5.0);
|
||||
|
||||
TEST_CYCLE()
|
||||
{
|
||||
cv::exp(src, dst);
|
||||
}
|
||||
|
||||
SANITY_CHECK_NOTHING();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// 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.
|
||||
|
||||
#include "perf_precomp.hpp"
|
||||
|
||||
namespace opencv_test { namespace {
|
||||
using namespace perf;
|
||||
|
||||
enum
|
||||
{
|
||||
FLIP_XY = 0,
|
||||
FLIP_X = 1,
|
||||
FLIP_Y = 2,
|
||||
};
|
||||
|
||||
#define FLIP_SIZES szQVGA, szVGA, sz1080p
|
||||
#define FLIP_TYPES CV_8UC1, CV_8UC3, CV_8UC4
|
||||
#define FLIP_CODES FLIP_X, FLIP_Y, FLIP_XY
|
||||
|
||||
CV_FLAGS(FlipCode, FLIP_X, FLIP_Y, FLIP_XY);
|
||||
typedef tuple<Size, MatType, FlipCode> Size_MatType_FlipCode_t;
|
||||
typedef perf::TestBaseWithParam<Size_MatType_FlipCode_t> Size_MatType_FlipCode;
|
||||
|
||||
PERF_TEST_P(Size_MatType_FlipCode,
|
||||
flip,
|
||||
testing::Combine(testing::Values(FLIP_SIZES),
|
||||
testing::Values(FLIP_TYPES),
|
||||
testing::Values(FLIP_CODES)))
|
||||
{
|
||||
Size sz = get<0>(GetParam());
|
||||
int matType = get<1>(GetParam());
|
||||
int flipCode = get<2>(GetParam()) - 1;
|
||||
|
||||
Mat src(sz, matType);
|
||||
Mat dst(sz, matType);
|
||||
|
||||
declare.in(src, WARMUP_RNG).out(dst);
|
||||
|
||||
TEST_CYCLE() cv::flip(src, dst, flipCode);
|
||||
|
||||
SANITY_CHECK_NOTHING();
|
||||
}
|
||||
|
||||
}} // namespace opencv_test
|
||||
Reference in New Issue
Block a user