fix loop boundary condition
authordanielenricocahall <danielenricocahall@gmail.com>
Wed, 21 Apr 2021 02:08:01 +0000 (22:08 -0400)
committerdanielenricocahall <danielenricocahall@gmail.com>
Wed, 21 Apr 2021 02:08:01 +0000 (22:08 -0400)
modules/stitching/src/matchers.cpp

index 4c6cce80383cd86a3a4f025960f8b4f483408439..b3f1c7a1bf0e5aeeb76a3e9f530bccdb443138ad 100644 (file)
@@ -826,7 +826,7 @@ void BestOf2NearestRangeMatcher::operator ()(const std::vector<ImageFeatures> &f
 
     std::vector<std::pair<int,int> > near_pairs;
     for (int i = 0; i < num_images - 1; ++i)
-        for (int j = i + 1; j < std::min(num_images, i + range_width_); ++j)
+        for (int j = i + 1; j < std::min(num_images, i + 1 + range_width_); ++j)
             if (features[i].keypoints.size() > 0 && features[j].keypoints.size() > 0 && mask_(i, j))
                 near_pairs.push_back(std::make_pair(i, j));