Skip to content

Commit 508810e

Browse files
author
Piotr Maślanka
authored
utilized fabs to fix the bug
1 parent 71b04a6 commit 508810e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opensfm/src/geometry/triangulation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <fstream>
88
#include <iostream>
99
#include <string>
10+
#include <math.h>
1011

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

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

6970
const T eps = T(1e-30);
7071
const T det = A.determinant();
71-
if ((det < eps) && (det > -eps)) {
72+
if (fabs(det) < eps) {
7273
return std::make_pair(false, Eigen::Matrix<T, 3, 1>());
7374
}
7475
const auto lambdas = A.inverse() * b;

0 commit comments

Comments
 (0)