diff --git a/modules/calib3d/src/calibinit.cpp b/modules/calib3d/src/calibinit.cpp index de956abe36..ed1c41f4cc 100644 --- a/modules/calib3d/src/calibinit.cpp +++ b/modules/calib3d/src/calibinit.cpp @@ -1216,7 +1216,7 @@ int ChessBoardDetector::cleanFoundConnectedQuads(std::vector& q // (since we want the rectangle to be as small as possible) // remove the quadrangle that causes the biggest reduction // in pattern size until we have the correct number - for (; quad_count > count; quad_count--) + while (quad_count > count) { double min_box_area = DBL_MAX; int min_box_area_index = -1;