From 1633a1c697d455bc63dcd7d89a596f349dcf0f24 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Thu, 25 Jun 2026 10:48:54 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=86=E7=B1=BB=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=9B=BE=E7=89=87resize(v1.2.5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgorithmModule/src/ImgCheckAnalysisy.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/AlgorithmModule/src/ImgCheckAnalysisy.cpp b/AlgorithmModule/src/ImgCheckAnalysisy.cpp index 25c7be6..0d28f44 100644 --- a/AlgorithmModule/src/ImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ImgCheckAnalysisy.cpp @@ -170,7 +170,7 @@ int ImgCheckAnalysisy::GetStatus() std::string ImgCheckAnalysisy::GetVersion() { - return std::string("BOE_1.2.3_" + std::string(__DATE__) + "_" + std::string(__TIME__)); + return std::string("BOE_1.2.5_" + std::string(__DATE__) + "_" + std::string(__TIME__)); } std::string ImgCheckAnalysisy::GetErrorInfo() @@ -3750,11 +3750,13 @@ int ImgCheckAnalysisy::AI_Classify_New(const cv::Mat &src_Img, cv::Rect qx_roi, if (3 != AI_detImage.channels()) { - cv::cvtColor(AI_detImage(task->roi), task->input, cv::COLOR_GRAY2BGR); + cv::Mat temsizeimg; + cv::resize(AI_detImage(task->roi), temsizeimg, sz); + cv::cvtColor(temsizeimg, task->input, cv::COLOR_GRAY2BGR); } else { - task->input = AI_detImage(task->roi).clone(); + cv::resize(AI_detImage(task->roi), task->input, sz); } task->engine = pAIDet; @@ -3768,6 +3770,12 @@ int ImgCheckAnalysisy::AI_Classify_New(const cv::Mat &src_Img, cv::Rect qx_roi, if (runner->PopResult(result)) { + // if (true) + // { + // printf("result->cls_score %f\n",result->cls_score); + // std::string classpath = std::to_string(result->cls_label) + "_" + std::to_string(result->cls_score) + ".png"; + // cv::imwrite(classpath, result->input); + // } int cls_num = result->cls_label; if (cls_num >= 0 && cls_num < maxcls) { @@ -3896,6 +3904,7 @@ int ImgCheckAnalysisy::AI_Classify_New(const cv::Mat &src_Img, cv::Rect qx_roi, if (true) { // 长宽比 + bool bIsLine = false; float flenr = 1; int len = 0; int widt = 0; @@ -3922,6 +3931,7 @@ int ImgCheckAnalysisy::AI_Classify_New(const cv::Mat &src_Img, cv::Rect qx_roi, // getchar(); cls_num = AI_CLass_QX_NAME_line; strclassName = "line"; + bIsLine = true; } // 长宽比过小,判断成 else if (flenr > 4 && @@ -3934,7 +3944,9 @@ int ImgCheckAnalysisy::AI_Classify_New(const cv::Mat &src_Img, cv::Rect qx_roi, // getchar(); cls_num = AI_CLass_QX_NAME_line; strclassName = "line"; + bIsLine = true; } + m_pdetlog->AddCheckstr(PrintLevel_3, DET_LOG_LEVEL_3, "AI_Classify_line", "bIsLine %d, flenr %f len %d,widt %d,fjustarea %f", bIsLine, flenr,len,widt,fjustarea); } }