diff --git a/gtsfm/averaging/rotation/shonan.py b/gtsfm/averaging/rotation/shonan.py index ad8643a43..0a1015183 100644 --- a/gtsfm/averaging/rotation/shonan.py +++ b/gtsfm/averaging/rotation/shonan.py @@ -33,6 +33,9 @@ _DEFAULT_TWO_VIEW_ROTATION_SIGMA = 1.0 +# The threshold for the smallest eigenvalue check in GTSAM. Defaults to -1e-4 in GTSAM. +_OPTIMALITY_THRESHOLD = -1e-5 + class ShonanRotationAveraging(RotationAveragingBase): """Performs Shonan rotation averaging.""" @@ -60,6 +63,7 @@ def __get_shonan_params(self) -> ShonanAveragingParameters3: shonan_params = ShonanAveragingParameters3(lm_params) shonan_params.setUseHuber(False) shonan_params.setCertifyOptimality(True) + shonan_params.setOptimalityThreshold(_OPTIMALITY_THRESHOLD) return shonan_params def __measurements_from_2view_relative_rotations(