Path: blob/master/modules/core/perf/perf_minmaxloc.cpp
16344 views
#include "perf_precomp.hpp"12namespace opencv_test3{4using namespace perf;56PERF_TEST_P(Size_MatType, minMaxLoc, testing::Combine(7testing::Values(TYPICAL_MAT_SIZES),8testing::Values(CV_8UC1, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1)9)10)11{12Size sz = get<0>(GetParam());13int matType = get<1>(GetParam());1415Mat src(sz, matType);16double minVal, maxVal;17Point minLoc, maxLoc;1819if (matType == CV_8U)20randu(src, 1, 254 /*do not include 0 and 255 to avoid early exit on 1 byte data*/);21else if (matType == CV_8S)22randu(src, -127, 126);23else24warmup(src, WARMUP_RNG);2526declare.in(src);2728TEST_CYCLE() minMaxLoc(src, &minVal, &maxVal, &minLoc, &maxLoc);2930SANITY_CHECK(minVal, 1e-12);31SANITY_CHECK(maxVal, 1e-12);32}3334} // namespace353637