1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

add HAL for adaptiveThreshold

This commit is contained in:
elenagvo
2017-11-23 11:40:54 +03:00
parent c4b158ff91
commit 11ddb9332c
4 changed files with 32 additions and 8 deletions
+9 -6
View File
@@ -60,15 +60,16 @@ PERF_TEST_P(Size_Only, threshold_otsu, testing::Values(TYPICAL_MAT_SIZES))
CV_ENUM(AdaptThreshType, THRESH_BINARY, THRESH_BINARY_INV)
CV_ENUM(AdaptThreshMethod, ADAPTIVE_THRESH_MEAN_C, ADAPTIVE_THRESH_GAUSSIAN_C)
typedef std::tr1::tuple<Size, AdaptThreshType, AdaptThreshMethod, int> Size_AdaptThreshType_AdaptThreshMethod_BlockSize_t;
typedef perf::TestBaseWithParam<Size_AdaptThreshType_AdaptThreshMethod_BlockSize_t> Size_AdaptThreshType_AdaptThreshMethod_BlockSize;
typedef std::tr1::tuple<Size, AdaptThreshType, AdaptThreshMethod, int, double> Size_AdaptThreshType_AdaptThreshMethod_BlockSize_Delta_t;
typedef perf::TestBaseWithParam<Size_AdaptThreshType_AdaptThreshMethod_BlockSize_Delta_t> Size_AdaptThreshType_AdaptThreshMethod_BlockSize_Delta;
PERF_TEST_P(Size_AdaptThreshType_AdaptThreshMethod_BlockSize, adaptiveThreshold,
PERF_TEST_P(Size_AdaptThreshType_AdaptThreshMethod_BlockSize_Delta, adaptiveThreshold,
testing::Combine(
testing::Values(TYPICAL_MAT_SIZES),
AdaptThreshType::all(),
AdaptThreshMethod::all(),
testing::Values(3, 5)
testing::Values(3, 5),
testing::Values(0.0, 10.0)
)
)
{
@@ -76,12 +77,14 @@ PERF_TEST_P(Size_AdaptThreshType_AdaptThreshMethod_BlockSize, adaptiveThreshold,
AdaptThreshType adaptThreshType = get<1>(GetParam());
AdaptThreshMethod adaptThreshMethod = get<2>(GetParam());
int blockSize = get<3>(GetParam());
double C = get<4>(GetParam());
double maxValue = theRNG().uniform(1, 254);
double C = 10.0;
int type = CV_8UC1;
Mat src(sz, type);
Mat src_full(cv::Size(sz.width + 2, sz.height + 2), type);
Mat src = src_full(cv::Rect(1, 1, sz.width, sz.height));
Mat dst(sz, type);
declare.in(src, WARMUP_RNG).out(dst);