Updated by Alexander Shishkov over 12 years ago

When mixing cv::Mat and cv::Matx for the source arguments in cv::add, OpenCV complains about not being to do the operation even though it should be possible.

A short example with 3x3 matrices should explain it quite well.

Error:
@cv::add(cv::Mat(3, 3, CV_32F), cv::Matx33f(), cv::Matx33f());@
Works (surrounded 2nd argument with cv::Mat)
@cv::add(cv::Mat(3, 3, CV_32F), cv::Mat(cv::Matx33f()), cv::Matx33f());@
Works too (not mixing src1 and src2)
@cv::add(cv::Matx33f(), cv::Matx33f(), cv::Matx33f());@

The problem seems to be that the arithm_op function is fine when the source kinds are equal, but does a wrong check otherwise and complains as soon as one of the input matrices is of type MatX. MATX.

Back