cv::Mat_ && cv::Vec conversion

asked 2013-12-25 09:09:26 -0500

v8786339 gravatar image

updated 2013-12-25 09:10:33 -0500

I use visual studio 2010 with opencv 2.46,while when I convert Mat_(such as Mat1d,not Mat) to Vec or Matx,I meet a strange mistake,vc says that it can't find the return value in function

template<typename _Tp> template<int n> inline Mat_<_Tp>::operator Vec<typename DataType<_Tp>::channel_type, n>() const at <mat.hpp>

we try to solve the problem by change the function to this

template<typename _Tp> template<int n> inline Mat_<_Tp>::operator Vec<typename DataType<_Tp>::channel_type, n>() const
{
    CV_Assert(n % DataType<_Tp>::channels == 0);
    Vec<typename DataType<_Tp>::channel_type, n> ret=this->Mat::operator Vec<typename DataType<_Tp>::channel_type, n>();

    return ret;
}

Then it works well... Can anybody tell me why it can happen ?

edit retag flag offensive close merge delete