Skip to content

Commit

Permalink
utilized fabs to fix the bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Maślanka authored May 28, 2021
1 parent 71b04a6 commit 508810e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion opensfm/src/geometry/triangulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <fstream>
#include <iostream>
#include <string>
#include <math.h>

double AngleBetweenVectors(const Eigen::Vector3d &u, const Eigen::Vector3d &v);

Expand Down Expand Up @@ -68,7 +69,7 @@ std::pair<bool, Eigen::Matrix<T, 3, 1>> TriangulateTwoBearingsMidpointSolve(

const T eps = T(1e-30);
const T det = A.determinant();
if ((det < eps) && (det > -eps)) {
if (fabs(det) < eps) {
return std::make_pair(false, Eigen::Matrix<T, 3, 1>());
}
const auto lambdas = A.inverse() * b;
Expand Down

0 comments on commit 508810e

Please sign in to comment.