From 9dab33eb2ce62ed5cea4b4fb16a048454d3652a9 Mon Sep 17 00:00:00 2001 From: bob Date: Tue, 20 Aug 2013 10:35:25 +0200 Subject: [PATCH] fixed iterative LinearLSTriangulation doing the same as the non-iterative one --- Chapter4_StructureFromMotion/Triangulation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Chapter4_StructureFromMotion/Triangulation.cpp b/Chapter4_StructureFromMotion/Triangulation.cpp index 45f6118..b77ef6d 100755 --- a/Chapter4_StructureFromMotion/Triangulation.cpp +++ b/Chapter4_StructureFromMotion/Triangulation.cpp @@ -73,9 +73,11 @@ Mat_ IterativeLinearLSTriangulation(Point3d u, //homogenous image point ) { double wi = 1, wi1 = 1; Mat_ X(4,1); - for (int i=0; i<10; i++) { //Hartley suggests 10 iterations at most - Mat_ X_ = LinearLSTriangulation(u,P,u1,P1); - X(0) = X_(0); X(1) = X_(1); X(2) = X_(2); X(3) = 1.0; + + Mat_ X_ = LinearLSTriangulation(u,P,u1,P1); + X(0) = X_(0); X(1) = X_(1); X(2) = X_(2); X(3) = 1.0; + + for (int i=0; i<10; i++) { //Hartley suggests 10 iterations at most //recalculate weights double p2x = Mat_(Mat_(P).row(2)*X)(0);