diff --git a/modules/ximgproc/src/fast_line_detector.cpp b/modules/ximgproc/src/fast_line_detector.cpp index 95a46a8429b..ced6c75ae0e 100644 --- a/modules/ximgproc/src/fast_line_detector.cpp +++ b/modules/ximgproc/src/fast_line_detector.cpp @@ -581,7 +581,7 @@ void FastLineDetectorImpl::lineDetection(const Mat& src, std::vector& s bool is_merged = false; int ith = (int)segments_tmp.size() - 1; int jth = ith - 1; - while(ith > 1 || jth > 0) + while(ith > 1 || jth >= 0) { seg1 = segments_tmp[ith]; seg2 = segments_tmp[jth];