From f15fa21c6b1292590046e0e7425c719cddeefbaf Mon Sep 17 00:00:00 2001 From: MaximSmolskiy Date: Tue, 31 Dec 2024 02:49:15 +0300 Subject: [PATCH] Speed up and reduce memory consumption for findContours --- modules/imgproc/src/contours_new.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/imgproc/src/contours_new.cpp b/modules/imgproc/src/contours_new.cpp index 0b82496aaa..9f8c716fbb 100644 --- a/modules/imgproc/src/contours_new.cpp +++ b/modules/imgproc/src/contours_new.cpp @@ -368,10 +368,6 @@ CNode& ContourScanner_::makeContour(schar& nbd_, const bool is_hole, const int x const Point start_pt(x - (is_hole ? 1 : 0), y); CNode& res = tree.newElem(); - if (isChain) - res.body.codes.reserve(200); - else - res.body.pts.reserve(200); res.body.isHole = is_hole; res.body.isChain = isChain; res.body.origin = start_pt + offset;