Commit 7a7dae36 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed problem with Mat::copyTo() with Mat_<> arguments (ticket #1918)

parent e7946227
...@@ -1352,7 +1352,7 @@ void _OutputArray::create(int dims, const int* size, int type, int i, bool allow ...@@ -1352,7 +1352,7 @@ void _OutputArray::create(int dims, const int* size, int type, int i, bool allow
if(CV_MAT_CN(type) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0 ) if(CV_MAT_CN(type) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0 )
type = m.type(); type = m.type();
else else
CV_Assert(!fixedType() || (CV_MAT_CN(type) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0)); CV_Assert(CV_MAT_TYPE(type) == m.type());
} }
if(fixedSize()) if(fixedSize())
{ {
......
...@@ -1504,6 +1504,14 @@ protected: ...@@ -1504,6 +1504,14 @@ protected:
d.convertTo(d1, depth); d.convertTo(d1, depth);
CV_Assert( norm(c, d1, CV_C) <= DBL_EPSILON ); CV_Assert( norm(c, d1, CV_C) <= DBL_EPSILON );
} }
Mat_<uchar> tmpSrc(100,100);
tmpSrc = 124;
Mat_<uchar> tmpMask(100,100);
tmpMask = 255;
Mat_<uchar> tmpDst(100,100);
tmpDst = 2;
tmpSrc.copyTo(tmpDst,tmpMask);
} }
catch(...) catch(...)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment