mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
fixed OutputArray::create, which resolves several failures in opencv_test_core
This commit is contained in:
parent
94e09f24c7
commit
dd45fe13d1
@ -1188,11 +1188,15 @@ void OutputArray::create(int dims, const int* size, int type, int i, bool alloca
|
|||||||
{
|
{
|
||||||
CV_Assert( i < 0 );
|
CV_Assert( i < 0 );
|
||||||
Mat& m = *(Mat*)obj;
|
Mat& m = *(Mat*)obj;
|
||||||
if( allocateVector && dims == 2 && m.dims == 2 &&
|
if( allocateVector )
|
||||||
m.type() == type && m.rows == size[1] && m.cols == size[0] && m.isContinuous())
|
{
|
||||||
return;
|
|
||||||
if( !m.isContinuous() )
|
if( !m.isContinuous() )
|
||||||
m.release();
|
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);
|
m.create(dims, size, type);
|
||||||
return;
|
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() );
|
CV_Assert( i < (int)v.size() );
|
||||||
Mat& m = v[i];
|
Mat& m = v[i];
|
||||||
|
|
||||||
if( allocateVector && dims == 2 && m.dims == 2 &&
|
if( allocateVector )
|
||||||
m.type() == type && m.rows == size[1] && m.cols == size[0] && m.isContinuous())
|
{
|
||||||
return;
|
|
||||||
if( !m.isContinuous() )
|
if( !m.isContinuous() )
|
||||||
m.release();
|
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);
|
m.create(dims, size, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user