提交 f87987ed 编写于 作者: A Andrey Kamaev

Honor multidimensional matrices in InputArray::total

上级 ffdbddd6
......@@ -1188,6 +1188,24 @@ Size _InputArray::size(int i) const
size_t _InputArray::total(int i) const
{
int k = kind();
if( k == MAT )
{
CV_Assert( i < 0 );
return ((const Mat*)obj)->total();
}
if( k == STD_VECTOR_MAT )
{
const vector<Mat>& vv = *(const vector<Mat>*)obj;
if( i < 0 )
return vv.size();
CV_Assert( i < (int)vv.size() );
return vv[i].total();
}
return size(i).area();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册