From 69e66d7bb53abadf15f94cd746dfa3401ea7f271 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Fri, 2 Aug 2013 13:37:15 +0400 Subject: [PATCH] fixed little bug in makeCameraPose --- modules/viz/src/viz.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/viz/src/viz.cpp b/modules/viz/src/viz.cpp index 94e4be5..2d563f6 100644 --- a/modules/viz/src/viz.cpp +++ b/modules/viz/src/viz.cpp @@ -22,13 +22,11 @@ cv::Affine3f cv::viz::makeTransformToGlobal(const Vec3f& axis_x, const Vec3f& ax cv::Affine3f cv::viz::makeCameraPose(const Vec3f& position, const Vec3f& focal_point, const Vec3f& y_dir) { // Compute the transformation matrix for drawing the camera frame in a scene - Vec3f u,v,n; - n = normalize(focal_point - position); - u = normalize(y_dir.cross(n)); - v = n.cross(u); + Vec3f n = normalize(focal_point - position); + Vec3f u = normalize(y_dir.cross(n)); + Vec3f v = n.cross(u); - Matx44f pose_mat; - pose_mat.zeros(); + Matx44f pose_mat = Matx44f::zeros(); pose_mat(0,0) = u[0]; pose_mat(0,1) = u[1]; pose_mat(0,2) = u[2]; @@ -86,4 +84,4 @@ namespace cv return reinterpret_cast(pointer); } } -} \ No newline at end of file +} -- 2.7.4