From 3655110ce27c63f09d93c30c2e50aad4816d2fa9 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Fri, 28 Aug 2026 12:43:17 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=94=B9=E4=B8=BA=E7=AE=80=E5=8D=95?= =?UTF-8?q?=E6=8B=BC=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgorithmModule/src/CameraCheckAnalysisy.cpp | 18 ++++++++++++-- AlgorithmModule/src/ImgCheckAnalysisy.cpp | 2 +- example/Read_Image.cpp | 26 +++++++++++--------- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/AlgorithmModule/src/CameraCheckAnalysisy.cpp b/AlgorithmModule/src/CameraCheckAnalysisy.cpp index 7daf496..624922c 100644 --- a/AlgorithmModule/src/CameraCheckAnalysisy.cpp +++ b/AlgorithmModule/src/CameraCheckAnalysisy.cpp @@ -160,8 +160,22 @@ int CameraCheckAnalysisy::Detect_Pre() } // printf("===66666666666666666\n"); - int re = Mergimg(pImageResult->result->in_shareImage->img, pImageResult->result->in_shareImage->img_B, - pImageResult->result->in_shareImage->strCameraName, pImageResult->result->in_shareImage->strChannel); + // int re = Mergimg(pImageResult->result->in_shareImage->img, pImageResult->result->in_shareImage->img_B, + // pImageResult->result->in_shareImage->strCameraName, pImageResult->result->in_shareImage->strChannel); + + // int re = MergimgTest(pImageResult->result->in_shareImage->img, pImageResult->result->in_shareImage->img_B, + // pImageResult->result->in_shareImage->strCameraName, pImageResult->result->in_shareImage->strChannel); + + // 简单硬拼接:img 在左,img_B 在右,拼接结果写回 img + if (pImageResult->result->in_shareImage->img.size() != pImageResult->result->in_shareImage->img_B.size() || + pImageResult->result->in_shareImage->img.type() != pImageResult->result->in_shareImage->img_B.type()) + { + m_pdetlog->AddCheckstr(PrintLevel_1, "Detect_Pre", "Cam %s ==================img size/type != img_B ", strBasic.c_str()); + return 1; + } + cv::Mat merge_img; + cv::hconcat(pImageResult->result->in_shareImage->img, pImageResult->result->in_shareImage->img_B, merge_img); + pImageResult->result->in_shareImage->img = merge_img; // 拼接完成后 img_B 不再需要,立即释放内存 pImageResult->result->in_shareImage->img_B.release(); diff --git a/AlgorithmModule/src/ImgCheckAnalysisy.cpp b/AlgorithmModule/src/ImgCheckAnalysisy.cpp index 76d6390..56bac62 100644 --- a/AlgorithmModule/src/ImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ImgCheckAnalysisy.cpp @@ -182,7 +182,7 @@ int ImgCheckAnalysisy::GetStatus() std::string ImgCheckAnalysisy::GetVersion() { - return std::string("BOE_1.0.0"); + return std::string("BOE_1.1.0"); } std::string ImgCheckAnalysisy::GetErrorInfo() diff --git a/example/Read_Image.cpp b/example/Read_Image.cpp index 87511d3..e6316fc 100644 --- a/example/Read_Image.cpp +++ b/example/Read_Image.cpp @@ -287,24 +287,26 @@ std::string Extract_ALL::Extract_Channel_Name(std::string strPath, int userflag) } int Extract_ALL::Read_Image_List(std::string strPath, std::string strproduct) { - std::string strSearchImgPath = strPath + "/*.jpg"; - Read_Camera_Product_Image(strSearchImgPath, 0, strproduct); - - strSearchImgPath = strPath + "/*.ytimage"; - Read_Camera_Product_Image(strSearchImgPath, 0, strproduct); + std::vector imgExts = {"*.jpg", "*.png", "*.bmp", "*.tif"}; + for (const auto &ext : imgExts) + { + std::string strSearchImgPath = strPath + "/" + ext; + Read_Camera_Product_Image(strSearchImgPath, 0, strproduct); + } return 0; } int Extract_ALL::Read_Image_List(std::string strPath_left, std::string strPath_right, std::string strproduct) { - std::string strSearchImgPath = strPath_left + "/*.jpg"; - Read_Camera_Product_Image(strSearchImgPath, 0, strproduct); - strSearchImgPath = strPath_right + "/*.jpg"; - Read_Camera_Product_Image(strSearchImgPath, 0, strproduct); - - // strSearchImgPath = strPath + "/*.jpg"; - // Read_Camera_Product_Image(strSearchImgPath, 1); + std::vector imgExts = {"*.jpg", "*.png", "*.bmp", "*.tif"}; + for (const auto &ext : imgExts) + { + std::string strSearchImgPath = strPath_left + "/" + ext; + Read_Camera_Product_Image(strSearchImgPath, 0, strproduct); + strSearchImgPath = strPath_right + "/" + ext; + Read_Camera_Product_Image(strSearchImgPath, 0, strproduct); + } return 0; }