Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I build the OpenCV 3.0.0 source codes and found the reason why the accumulate() threw an exception.

Mat::Size() is called in cv::accumulate():

// improc/src/accum.cpp
void cv::accumulate( InputArray _src, InputOutputArray _dst, InputArray _mask )
{
     ....
     Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat();
     ....
      Size size = src.size();
    ....
}

However, the Mat::MatSize::operator() does not support 3d matrix:

// opencv2/core/mat.inl.hpp
inline
Size MatSize::operator()() const
{
    CV_DbgAssert(p[-1] <= 2);
    return Size(p[1], p[0]);
}

So I guess the cv::accumulate() in OpenCV 3.0.0 does not support 3d matrix.

I build the OpenCV 3.0.0 source codes and found the reason why the accumulate() threw an exception.

Mat::Size() is called in cv::accumulate():

// improc/src/accum.cpp
void cv::accumulate( InputArray _src, InputOutputArray _dst, InputArray _mask )
{
     ....
     Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat();
     ....
      Size size = src.size();
    ....
}

However, the Mat::MatSize::operator() does not support 3d matrix:

// opencv2/core/mat.inl.hpp
inline
Size MatSize::operator()() const
{
    CV_DbgAssert(p[-1] <= 2);
    return Size(p[1], p[0]);
}

So I guess the cv::accumulate() in OpenCV 3.0.0 does not support 3d matrix.

Please tell me if I am wrong.

I build the OpenCV 3.0.0 source codes and found the reason why the accumulate() threw an exception.

Mat::Size() is called in cv::accumulate():

// improc/src/accum.cpp
void cv::accumulate( InputArray _src, InputOutputArray _dst, InputArray _mask )
{
     ....
     Mat src = _src.getMat(), dst = _dst.getMat(), mask = _mask.getMat();
     ....
      Size size = src.size();
    ....
}

However, the Mat::MatSize::operator() does not support 3d matrix:

// opencv2/core/mat.inl.hpp
inline
Size MatSize::operator()() const
{
    CV_DbgAssert(p[-1] <= 2);
    return Size(p[1], p[0]);
}

So I guess the cv::accumulate() in OpenCV 3.0.0 does not support 3d matrix.

Please tell correct me if I am wrong.