From f2fbfd7a10468946199c43c4e446d03505c23ac0 Mon Sep 17 00:00:00 2001 From: cDc Date: Tue, 17 Apr 2018 13:30:56 +0300 Subject: [PATCH] fix bug in Matx::inv() --- modules/core/include/opencv2/core/operations.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/include/opencv2/core/operations.hpp b/modules/core/include/opencv2/core/operations.hpp index e5d1a7e80a..75864ea822 100644 --- a/modules/core/include/opencv2/core/operations.hpp +++ b/modules/core/include/opencv2/core/operations.hpp @@ -194,8 +194,8 @@ Matx<_Tp, n, m> Matx<_Tp, m, n>::inv(int method, bool *p_is_ok /*= NULL*/) const { Matx<_Tp, n, m> b; bool ok; - if( method == DECOMP_LU || method == DECOMP_CHOLESKY ) - ok = cv::internal::Matx_FastInvOp<_Tp, m>()(*this, b, method); + if( m == n && (method == DECOMP_LU || method == DECOMP_CHOLESKY) ) + ok = cv::internal::Matx_FastInvOp<_Tp, m>()(*reinterpret_cast*>(this), reinterpret_cast&>(b), method); else { Mat A(*this, false), B(b, false); -- GitLab