From 38480076e9974df6eefa6623fa6cbdefe8c909d3 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Thu, 8 Oct 2026 11:26:49 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E4=BC=A0=E5=85=A5=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=AF=B9=E7=AB=96=E5=9B=BE=E6=97=8B=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgorithmModule/src/ALLImgCheckAnalysisy.cpp | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp b/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp index 60a898e..00e7387 100644 --- a/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp @@ -616,6 +616,28 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr p) return CHECK_ERROR_Config_Null; } + // 对传入图片做一步判断,如果高大于宽,则顺时针旋转90° + if (p->Det_Mode != DET_MODE_ReJson) + { + if (!p->img.empty() && p->img.rows > p->img.cols) + { + cv::Mat imgRot; + cv::rotate(p->img, imgRot, cv::ROTATE_90_CLOCKWISE); + printf("PushInImg rotate 90CW: SN %s channel %s img [%d x %d] -> [%d x %d]\n", + p->strImgProductID.c_str(), p->strChannel.c_str(), + p->img.cols, p->img.rows, imgRot.cols, imgRot.rows); + p->img = imgRot; + } + if (!p->img_B.empty() && p->img_B.rows > p->img_B.cols) + { + cv::Mat imgBRot; + cv::rotate(p->img_B, imgBRot, cv::ROTATE_90_CLOCKWISE); + printf("PushInImg rotate 90CW: SN %s channel %s img_B [%d x %d] -> [%d x %d]\n", + p->strImgProductID.c_str(), p->strChannel.c_str(), + p->img_B.cols, p->img_B.rows, imgBRot.cols, imgBRot.rows); + p->img_B = imgBRot; + } + } std::string strlog = ""; m_strTest += " PushInImg->SN:"; m_strTest += p->strImgProductID;