From 9198e306884f11b5461fa17ff7385d7da775aa01 Mon Sep 17 00:00:00 2001 From: KaurkerDevourer Date: Fri, 11 Feb 2022 14:38:48 +0300 Subject: [PATCH] Fix DpSeamFinder::hasOnlyOneNeighbor std::lower_bound is linear for set https://en.cppreference.com/w/cpp/algorithm/lower_bound --- modules/stitching/src/seam_finders.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/stitching/src/seam_finders.cpp b/modules/stitching/src/seam_finders.cpp index c8a320dc74..a19f5a6cfc 100644 --- a/modules/stitching/src/seam_finders.cpp +++ b/modules/stitching/src/seam_finders.cpp @@ -554,8 +554,8 @@ void DpSeamFinder::computeGradients(const Mat &image1, const Mat &image2) bool DpSeamFinder::hasOnlyOneNeighbor(int comp) { std::set >::iterator begin, end; - begin = lower_bound(edges_.begin(), edges_.end(), std::make_pair(comp, std::numeric_limits::min())); - end = upper_bound(edges_.begin(), edges_.end(), std::make_pair(comp, std::numeric_limits::max())); + begin = edges_.lower_bound(std::make_pair(comp, std::numeric_limits::min())); + end = edges_.upper_bound(std::make_pair(comp, std::numeric_limits::max())); return ++begin == end; }