trying to fix failures in tests

pull/1663/head
Vadim Pisarevsky 11 years ago
parent 303df78cca
commit a9065b7d0c
  1. 2
      modules/core/src/convert.cpp
  2. 12
      modules/core/src/matrix.cpp

@ -271,7 +271,7 @@ void cv::split(InputArray _m, OutputArrayOfArrays _mv)
_mv.release();
return;
}
CV_Assert( !_mv.fixedType() || _mv.type() == m.depth() );
CV_Assert( !_mv.fixedType() || _mv.empty() || _mv.type() == m.depth() );
_mv.create(m.channels(), 1, m.depth());
Mat* dst = &_mv.getMatRef(0);
split(m, dst);

@ -1469,9 +1469,6 @@ int _InputArray::type(int i) const
{
int k = kind();
if( k == MATX || k == STD_VECTOR || k == STD_VECTOR_VECTOR || (flags & FIXED_TYPE))
return CV_MAT_TYPE(flags);
if( k == MAT )
return ((const Mat*)obj)->type();
@ -1481,14 +1478,21 @@ int _InputArray::type(int i) const
if( k == EXPR )
return ((const MatExpr*)obj)->type();
if( k == MATX || k == STD_VECTOR || k == STD_VECTOR_VECTOR )
return CV_MAT_TYPE(flags);
if( k == NONE )
return -1;
if( k == STD_VECTOR_MAT )
{
const std::vector<Mat>& vv = *(const std::vector<Mat>*)obj;
if( vv.empty() )
{
CV_Assert((flags & FIXED_TYPE) != 0);
return CV_MAT_TYPE(flags);
}
CV_Assert( i < (int)vv.size() );
return vv[i >= 0 ? i : 0].type();
}

Loading…
Cancel
Save