diff --git a/modules/core/include/opencv2/core/mat.hpp b/modules/core/include/opencv2/core/mat.hpp index 4cb12cccc1..8ddc16eb1d 100644 --- a/modules/core/include/opencv2/core/mat.hpp +++ b/modules/core/include/opencv2/core/mat.hpp @@ -1075,7 +1075,9 @@ template template inline Mat_<_Tp>::operator Vec template inline Mat_<_Tp>::operator Matx::channel_type, m, n>() const { CV_Assert(n % DataType<_Tp>::channels == 0); - return this->Mat::operator Matx::channel_type, m, n>(); + + Matx::channel_type, m, n> res = this->Mat::operator Matx::channel_type, m, n>(); + return res; } template inline void