diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp index decf6c907..4c52d210e 100644 --- a/modules/core/include/opencv2/core/core.hpp +++ b/modules/core/include/opencv2/core/core.hpp @@ -492,7 +492,7 @@ public: Matx<_Tp, m, 1> col(int i) const; //! extract the matrix diagonal - Matx<_Tp, MIN(m,n), 1> diag() const; + diag_type diag() const; //! transpose the matrix Matx<_Tp, n, m> t() const; diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index 7e6a3b035..d0fdc7120 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -360,7 +360,7 @@ template inline double Matx<_Tp, m, n>::ddot(const M template inline -Matx<_Tp,m,n> Matx<_Tp,m,n>::diag(const Matx<_Tp,MIN(m,n),1>& d) +Matx<_Tp,m,n> Matx<_Tp,m,n>::diag(const typename Matx<_Tp,m,n>::diag_type& d) { Matx<_Tp,m,n> M; for(int i = 0; i < MIN(m,n); i++) @@ -436,7 +436,7 @@ Matx<_Tp, m, 1> Matx<_Tp, m, n>::col(int j) const template inline -Matx<_Tp, MIN(m,n), 1> Matx<_Tp, m, n>::diag() const +typename Matx<_Tp, m, n>::diag_type Matx<_Tp, m, n>::diag() const { diag_type d; for( int i = 0; i < MIN(m, n); i++ )