1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2019-03-11 19:20:22 +00:00
48 changed files with 7633 additions and 5337 deletions
+16 -26
View File
@@ -1288,17 +1288,12 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
{
CV_Assert( i < 0 );
Mat& m = *(Mat*)obj;
if( allowTransposed )
if (allowTransposed && !m.empty() &&
d == 2 && m.dims == 2 &&
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] &&
m.isContinuous())
{
if( !m.isContinuous() )
{
CV_Assert(!fixedType() && !fixedSize());
m.release();
}
if( d == 2 && m.dims == 2 && m.data &&
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] )
return;
return;
}
if(fixedType())
@@ -1306,13 +1301,13 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
if(CV_MAT_CN(mtype) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0 )
mtype = m.type();
else
CV_Assert(CV_MAT_TYPE(mtype) == m.type());
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "");
}
if(fixedSize())
{
CV_Assert(m.dims == d);
CV_CheckEQ(m.dims, d, "");
for(int j = 0; j < d; ++j)
CV_Assert(m.size[j] == sizes[j]);
CV_CheckEQ(m.size[j], sizes[j], "");
}
m.create(d, sizes, mtype);
return;
@@ -1322,17 +1317,12 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
{
CV_Assert( i < 0 );
UMat& m = *(UMat*)obj;
if( allowTransposed )
if (allowTransposed && !m.empty() &&
d == 2 && m.dims == 2 &&
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] &&
m.isContinuous())
{
if( !m.isContinuous() )
{
CV_Assert(!fixedType() && !fixedSize());
m.release();
}
if( d == 2 && m.dims == 2 && !m.empty() &&
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] )
return;
return;
}
if(fixedType())
@@ -1340,13 +1330,13 @@ void _OutputArray::create(int d, const int* sizes, int mtype, int i,
if(CV_MAT_CN(mtype) == m.channels() && ((1 << CV_MAT_TYPE(flags)) & fixedDepthMask) != 0 )
mtype = m.type();
else
CV_Assert(CV_MAT_TYPE(mtype) == m.type());
CV_CheckTypeEQ(m.type(), CV_MAT_TYPE(mtype), "");
}
if(fixedSize())
{
CV_Assert(m.dims == d);
CV_CheckEQ(m.dims, d, "");
for(int j = 0; j < d; ++j)
CV_Assert(m.size[j] == sizes[j]);
CV_CheckEQ(m.size[j], sizes[j], "");
}
m.create(d, sizes, mtype);
return;