Ask Your Question

v8786339's profile - activity

2013-12-26 02:53:41 -0500 received badge  Student (source)
2013-12-25 09:10:33 -0500 received badge  Editor (source)
2013-12-25 09:09:26 -0500 asked a question cv::Mat_ && cv::Vec conversion

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 ?