reverted dangerous change in _InputArray::size()

This commit is contained in:
Vadim Pisarevsky 2013-02-28 23:02:04 +04:00
parent 374e3a0890
commit d925879366
2 changed files with 5 additions and 5 deletions

View File

@ -1145,7 +1145,7 @@ Size _InputArray::size(int i) const
const std::vector<uchar>& v = *(const std::vector<uchar>*)obj;
const std::vector<int>& iv = *(const std::vector<int>*)obj;
size_t szb = v.size(), szi = iv.size();
return szb == szi ? Size(1, (int)szb) : Size(1, (int)(szb/CV_ELEM_SIZE(flags)));
return szb == szi ? Size((int)szb, 1) : Size((int)(szb/CV_ELEM_SIZE(flags)), 1);
}
if( k == NONE )
@ -1155,19 +1155,19 @@ Size _InputArray::size(int i) const
{
const std::vector<std::vector<uchar> >& vv = *(const std::vector<std::vector<uchar> >*)obj;
if( i < 0 )
return vv.empty() ? Size() : Size(1, (int)vv.size());
return vv.empty() ? Size() : Size((int)vv.size(), 1);
CV_Assert( i < (int)vv.size() );
const std::vector<std::vector<int> >& ivv = *(const std::vector<std::vector<int> >*)obj;
size_t szb = vv[i].size(), szi = ivv[i].size();
return szb == szi ? Size(1, (int)szb) : Size(1, (int)(szb/CV_ELEM_SIZE(flags)));
return szb == szi ? Size((int)szb, 1) : Size((int)(szb/CV_ELEM_SIZE(flags)), 1);
}
if( k == STD_VECTOR_MAT )
{
const std::vector<Mat>& vv = *(const std::vector<Mat>*)obj;
if( i < 0 )
return vv.empty() ? Size() : Size(1, (int)vv.size());
return vv.empty() ? Size() : Size((int)vv.size(), 1);
CV_Assert( i < (int)vv.size() );
return vv[i].size();

View File

@ -487,7 +487,7 @@ bool CV_OperationsTest::TestSubMatAccess()
coords.push_back(T_bs(i));
//std::cout << T_bs1(i) << std::endl;
}
CV_Assert( norm(coords, T_bs.reshape(1,1).t(), NORM_INF) == 0 );
CV_Assert( norm(coords, T_bs.reshape(1,1), NORM_INF) == 0 );
}
catch (const test_excep& e)
{