From b2a7c116f281a195802cf83b53aea1ea773d1b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Pleskot?= Date: Tue, 5 Oct 2021 14:07:55 +0200 Subject: [PATCH] ComputeMeanVariance fix against NaNs in variance --- src/theia/sfm/filter_view_pairs_from_relative_translation.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theia/sfm/filter_view_pairs_from_relative_translation.cc b/src/theia/sfm/filter_view_pairs_from_relative_translation.cc index b7a7783a8..04f49812b 100644 --- a/src/theia/sfm/filter_view_pairs_from_relative_translation.cc +++ b/src/theia/sfm/filter_view_pairs_from_relative_translation.cc @@ -191,7 +191,7 @@ void ComputeMeanVariance( for (const auto& translation : relative_translations) { *variance += (translation.second - *mean).cwiseAbs2(); } - *variance /= static_cast(relative_translations.size() - 1); + *variance /= static_cast(relative_translations.size()); } // Performs a single iterations of the translation filtering. This method is