mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 14:13:15 +08:00
Merge pull request #473 from prclibo:2.4
This commit is contained in:
commit
2495b23a7d
@ -1243,10 +1243,14 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
|
|||||||
bool haveMask = !_mask.empty();
|
bool haveMask = !_mask.empty();
|
||||||
bool reallocate = false;
|
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 &&
|
if( (kind1 == kind2 || src1.channels() == 1) && src1.dims <= 2 && src2.dims <= 2 &&
|
||||||
src1.size() == src2.size() && src1.type() == src2.type() &&
|
src1.size() == src2.size() && src1.type() == src2.type() &&
|
||||||
!haveMask && ((!_dst.fixedType() && (dtype < 0 || CV_MAT_DEPTH(dtype) == src1.depth())) ||
|
!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());
|
_dst.create(src1.size(), src1.type());
|
||||||
Mat dst = _dst.getMat();
|
Mat dst = _dst.getMat();
|
||||||
|
Loading…
Reference in New Issue
Block a user