Commit dd45fe13 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed OutputArray::create, which resolves several failures in opencv_test_core

parent 94e09f24
......@@ -1188,11 +1188,15 @@ void OutputArray::create(int dims, const int* size, int type, int i, bool alloca
{
CV_Assert( i < 0 );
Mat& m = *(Mat*)obj;
if( allocateVector && dims == 2 && m.dims == 2 &&
m.type() == type && m.rows == size[1] && m.cols == size[0] && m.isContinuous())
return;
if( allocateVector )
{
if( !m.isContinuous() )
m.release();
if( dims == 2 && m.dims == 2 && m.data &&
m.type() == type && m.rows == size[1] && m.cols == size[0] )
return;
}
m.create(dims, size, type);
return;
}
......@@ -1310,11 +1314,15 @@ void OutputArray::create(int dims, const int* size, int type, int i, bool alloca
CV_Assert( i < (int)v.size() );
Mat& m = v[i];
if( allocateVector && dims == 2 && m.dims == 2 &&
m.type() == type && m.rows == size[1] && m.cols == size[0] && m.isContinuous())
return;
if(!m.isContinuous())
if( allocateVector )
{
if( !m.isContinuous() )
m.release();
if( dims == 2 && m.dims == 2 && m.data &&
m.type() == type && m.rows == size[1] && m.cols == size[0] )
return;
}
m.create(dims, size, type);
}
}
......
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