added support for vector<Mat_<>> in InputArray, OutputArray, split & merge

This commit is contained in:
Vadim Pisarevsky
2012-05-11 13:36:48 +00:00
parent 7a7dae3627
commit 52797a55e2
5 changed files with 69 additions and 21 deletions

View File

@@ -1470,10 +1470,21 @@ void _OutputArray::create(int dims, const int* size, int type, int i, bool allow
if( i < 0 )
{
CV_Assert( dims == 2 && (size[0] == 1 || size[1] == 1 || size[0]*size[1] == 0) );
size_t len = size[0]*size[1] > 0 ? size[0] + size[1] - 1 : 0;
size_t len = size[0]*size[1] > 0 ? size[0] + size[1] - 1 : 0, len0 = v.size();
CV_Assert(!fixedSize() || len == v.size());
CV_Assert(!fixedSize() || len == len0);
v.resize(len);
if( fixedType() )
{
int type = CV_MAT_TYPE(flags);
for( size_t j = len0; j < len; j++ )
{
if( v[i].type() == type )
continue;
CV_Assert( v[i].empty() );
v[i].flags = (v[i].flags & ~CV_MAT_TYPE_MASK) | type;
}
}
return;
}