Limit 32S data in perf test for addWeighted to avoid integer overflow

This commit is contained in:
Andrey Kamaev 2012-10-23 12:07:32 +04:00
parent c13eb07d47
commit b45a870d9a

View File

@ -23,6 +23,13 @@ PERF_TEST_P(Size_MatType, addWeighted, TYPICAL_MATS_ADWEIGHTED)
declare.in(src1, src2, dst, WARMUP_RNG).out(dst); declare.in(src1, src2, dst, WARMUP_RNG).out(dst);
if (CV_MAT_DEPTH(type) == CV_32S)
{
//see ticket 1529: absdiff can be without saturation on 32S
src1 /= 8;
src2 /= 8;
}
TEST_CYCLE() cv::addWeighted( src1, alpha, src2, beta, gamma, dst, dst.type() ); TEST_CYCLE() cv::addWeighted( src1, alpha, src2, beta, gamma, dst, dst.type() );
SANITY_CHECK(dst); SANITY_CHECK(dst);