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();