From 2139cd583fd8c317d3addfa6a9d042d9ea1af8c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 5 Jun 2020 13:19:19 +0200 Subject: [PATCH] Fix overdetermined similarity transform estimation --- src/base/similarity_transform.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/similarity_transform.cc b/src/base/similarity_transform.cc index 9b88fc5a1..19b18df19 100755 --- a/src/base/similarity_transform.cc +++ b/src/base/similarity_transform.cc @@ -64,10 +64,11 @@ struct ReconstructionAlignmentEstimator { const std::vector& images2) const { CHECK_GE(images1.size(), 3); CHECK_GE(images2.size(), 3); + CHECK_EQ(images1.size(), images2.size()); std::vector proj_centers1(images1.size()); std::vector proj_centers2(images2.size()); - for (size_t i = 0; i < 3; ++i) { + for (size_t i = 0; i < images1.size(); ++i) { CHECK_EQ(images1[i]->ImageId(), images2[i]->ImageId()); proj_centers1[i] = images1[i]->ProjectionCenter(); proj_centers2[i] = images2[i]->ProjectionCenter();