From 132c071345e2abead3d39a7425d8eb5ef2db58eb Mon Sep 17 00:00:00 2001 From: buptlihang <18801481780@163.com> Date: Fri, 23 Apr 2021 14:19:41 +0800 Subject: [PATCH] add PolygonScoreAcc to improve polygon detect --- deploy/cpp_infer/src/postprocess_op.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deploy/cpp_infer/src/postprocess_op.cpp b/deploy/cpp_infer/src/postprocess_op.cpp index 1c13f8aa..1b71c210 100644 --- a/deploy/cpp_infer/src/postprocess_op.cpp +++ b/deploy/cpp_infer/src/postprocess_op.cpp @@ -170,10 +170,10 @@ float PostProcessor::PolygonScoreAcc(std::vector contour, box_y.push_back(contour[i].y); } - int xmin = std::clamp(int(std::floor(*(std::min_element(box_x.begin(), box_x.end())))), 0, width - 1); - int xmax = std::clamp(int(std::ceil(*(std::max_element(box_x.begin(), box_x.end())))), 0, width - 1); - int ymin = std::clamp(int(std::floor(*(std::min_element(box_y.begin(), box_y.end())))), 0, height - 1); - int ymax = std::clamp(int(std::ceil(*(std::max_element(box_y.begin(), box_y.end())))), 0, height - 1); + int xmin = clamp(int(std::floor(*(std::min_element(box_x.begin(), box_x.end())))), 0, width - 1); + int xmax = clamp(int(std::ceil(*(std::max_element(box_x.begin(), box_x.end())))), 0, width - 1); + int ymin = clamp(int(std::floor(*(std::min_element(box_y.begin(), box_y.end())))), 0, height - 1); + int ymax = clamp(int(std::ceil(*(std::max_element(box_y.begin(), box_y.end())))), 0, height - 1); cv::Mat mask; mask = cv::Mat::zeros(ymax - ymin + 1, xmax - xmin + 1, CV_8UC1);