From 70e6391f38632f65427c7dbc6bdae4752893e147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Mewes?= Date: Thu, 13 Apr 2017 14:39:10 +0200 Subject: [PATCH] create homogeneous affine matrix when constructing from 4x3 cv::Mat --- modules/core/include/opencv2/core/affine.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/core/include/opencv2/core/affine.hpp b/modules/core/include/opencv2/core/affine.hpp index 311ff62637..41de5c6b57 100644 --- a/modules/core/include/opencv2/core/affine.hpp +++ b/modules/core/include/opencv2/core/affine.hpp @@ -213,11 +213,13 @@ cv::Affine3::Affine3(const cv::Mat& data, const Vec3& t) { rotation(data(Rect(0, 0, 3, 3))); translation(data(Rect(3, 0, 1, 3))); - return; + } + else + { + rotation(data); + translation(t); } - rotation(data); - translation(t); matrix.val[12] = matrix.val[13] = matrix.val[14] = 0; matrix.val[15] = 1; }