diff --git a/modules/core/include/opencv2/core/matx.hpp b/modules/core/include/opencv2/core/matx.hpp index 86a35cd756..010e028289 100644 --- a/modules/core/include/opencv2/core/matx.hpp +++ b/modules/core/include/opencv2/core/matx.hpp @@ -154,7 +154,7 @@ public: Matx<_Tp, n, m> t() const; //! invert matrix the matrix - Matx<_Tp, n, m> inv(int method=DECOMP_LU) const; + Matx<_Tp, n, m> inv(int method=DECOMP_LU, bool *p_is_ok = NULL) const; //! solve linear system template Matx<_Tp, n, l> solve(const Matx<_Tp, m, l>& rhs, int flags=DECOMP_LU) const; diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index f8aeddfb11..ea23f60f12 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -186,7 +186,7 @@ Matx<_Tp,m,n> Matx<_Tp,m,n>::randn(_Tp a, _Tp b) } template inline -Matx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method) const +Matx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method, bool *p_is_ok /*= NULL*/) const { Matx<_Tp, n, m> b; bool ok; @@ -197,6 +197,7 @@ Matx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method) const Mat A(*this, false), B(b, false); ok = (invert(A, B, method) != 0); } + if( NULL != p_is_ok ) { *p_is_ok = ok; } return ok ? b : Matx<_Tp, n, m>::zeros(); }