Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/core/perf/perf_minmaxloc.cpp
16344 views
1
#include "perf_precomp.hpp"
2
3
namespace opencv_test
4
{
5
using namespace perf;
6
7
PERF_TEST_P(Size_MatType, minMaxLoc, testing::Combine(
8
testing::Values(TYPICAL_MAT_SIZES),
9
testing::Values(CV_8UC1, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1)
10
)
11
)
12
{
13
Size sz = get<0>(GetParam());
14
int matType = get<1>(GetParam());
15
16
Mat src(sz, matType);
17
double minVal, maxVal;
18
Point minLoc, maxLoc;
19
20
if (matType == CV_8U)
21
randu(src, 1, 254 /*do not include 0 and 255 to avoid early exit on 1 byte data*/);
22
else if (matType == CV_8S)
23
randu(src, -127, 126);
24
else
25
warmup(src, WARMUP_RNG);
26
27
declare.in(src);
28
29
TEST_CYCLE() minMaxLoc(src, &minVal, &maxVal, &minLoc, &maxLoc);
30
31
SANITY_CHECK(minVal, 1e-12);
32
SANITY_CHECK(maxVal, 1e-12);
33
}
34
35
} // namespace
36
37