diff --git a/modules/core/perf/perf_merge.cpp b/modules/core/perf/perf_merge.cpp index e7e8d2fe3f..6af7feeb41 100644 --- a/modules/core/perf/perf_merge.cpp +++ b/modules/core/perf/perf_merge.cpp @@ -22,16 +22,19 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge, int srcDepth = get<1>(GetParam()); int dstChannels = get<2>(GetParam()); + int maxValue = 255; + vector mv; for( int i = 0; i < dstChannels; ++i ) { mv.push_back( Mat(sz, CV_MAKETYPE(srcDepth, 1)) ); - randu(mv[i], 0, 255); + randu(mv[i], 0, maxValue); } Mat dst; int runs = (sz.width <= 640) ? 8 : 1; TEST_CYCLE_MULTIRUN(runs) merge( (vector &)mv, dst ); - SANITY_CHECK(dst, 1e-12); + double eps = srcDepth <= CV_32S ? 1e-12 : (FLT_EPSILON * maxValue); + SANITY_CHECK(dst, eps); }