Skip to content

Commit

Permalink
fixed iterative LinearLSTriangulation doing the same as the non-itera…
Browse files Browse the repository at this point in the history
…tive one
  • Loading branch information
bob authored and bob committed Aug 20, 2013
1 parent 8736df1 commit 9dab33e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Chapter4_StructureFromMotion/Triangulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ Mat_<double> IterativeLinearLSTriangulation(Point3d u, //homogenous image point
) {
double wi = 1, wi1 = 1;
Mat_<double> X(4,1);
for (int i=0; i<10; i++) { //Hartley suggests 10 iterations at most
Mat_<double> X_ = LinearLSTriangulation(u,P,u1,P1);
X(0) = X_(0); X(1) = X_(1); X(2) = X_(2); X(3) = 1.0;

Mat_<double> 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_<double>(Mat_<double>(P).row(2)*X)(0);
Expand Down

0 comments on commit 9dab33e

Please sign in to comment.