From: Bo Li Date: Mon, 11 Feb 2013 14:09:42 +0000 (+0100) Subject: fix issue 2788 X-Git-Tag: accepted/2.0/20130307.220821~100^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=92e7e7d8e8be9e8721f408603b5fbb7e9bd5e10f;p=profile%2Fivi%2Fopencv.git fix issue 2788 --- diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index 0fa306c..5fda141 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -1242,11 +1242,15 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst, Mat src1 = _src1.getMat(), src2 = _src2.getMat(); bool haveMask = !_mask.empty(); bool reallocate = false; + + bool src1Scalar = checkScalar(src1, src2.type(), kind1, kind2); + bool src2Scalar = checkScalar(src2, src1.type(), kind2, kind1); if( (kind1 == kind2 || src1.channels() == 1) && src1.dims <= 2 && src2.dims <= 2 && src1.size() == src2.size() && src1.type() == src2.type() && !haveMask && ((!_dst.fixedType() && (dtype < 0 || CV_MAT_DEPTH(dtype) == src1.depth())) || - (_dst.fixedType() && _dst.type() == _src1.type())) ) + (_dst.fixedType() && _dst.type() == _src1.type())) && + ((src1Scalar && src2Scalar) || (!src1Scalar && !src2Scalar)) ) { _dst.create(src1.size(), src1.type()); Mat dst = _dst.getMat();