From 53878afe4fdcf82074992e16105f16a80dc3c2d7 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Fri, 17 Jul 2026 13:33:59 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=A8=A1=E5=9E=8B=E5=90=8D=EF=BC=8C=E7=B2=BE?= =?UTF-8?q?=E7=AE=80=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AIEngineModule/src/AI_Factory.cpp | 2 +- .../include/CheckErrorCodeDefine.hpp | 2 +- AlgorithmModule/src/AI_Edge_QX_Det.cpp | 4 +- AlgorithmModule/src/CameraCheckAnalysisy.cpp | 12 ++- AlgorithmModule/src/ImgCheckAnalysisy.cpp | 2 +- ConfigModule/include/CheckConfigDefine.h | 79 ++++++++++--------- ConfigModule/src/JsonConfig.cpp | 30 ++++--- 7 files changed, 68 insertions(+), 63 deletions(-) diff --git a/AIEngineModule/src/AI_Factory.cpp b/AIEngineModule/src/AI_Factory.cpp index 3d79bcb..f1da06f 100644 --- a/AIEngineModule/src/AI_Factory.cpp +++ b/AIEngineModule/src/AI_Factory.cpp @@ -160,7 +160,7 @@ int AIFactory::InitALLAIModle(GPU_Config gupconfig) AI_defect_Tag = AIModel_Base::GetInstance(); AIModel_Base::AIModelRun_Config boe_config; boe_config.gpuconfig.copy(gupconfig); - boe_config.strPath = "/home/aidlux/BOE/UseModel_FOG/defect_L127.engine"; + boe_config.strPath = "/home/aidlux/BOE/UseModel_FOG/defect_Tag.engine"; boe_config.strName = "tag"; boe_config.inputType = AIModel_Base::Input_CHW; AI_defect_Tag->Init(boe_config); diff --git a/AlgorithmModule/include/CheckErrorCodeDefine.hpp b/AlgorithmModule/include/CheckErrorCodeDefine.hpp index 63cfbec..3b72020 100644 --- a/AlgorithmModule/include/CheckErrorCodeDefine.hpp +++ b/AlgorithmModule/include/CheckErrorCodeDefine.hpp @@ -26,7 +26,7 @@ // resize 图片的 宽度 #define RESIZE_IMAGE_WIDTH 1680 -// #define AI_Time +#define AI_Time enum TEM_IMG_IDX_ { diff --git a/AlgorithmModule/src/AI_Edge_QX_Det.cpp b/AlgorithmModule/src/AI_Edge_QX_Det.cpp index 02a89f0..b0429cc 100644 --- a/AlgorithmModule/src/AI_Edge_QX_Det.cpp +++ b/AlgorithmModule/src/AI_Edge_QX_Det.cpp @@ -129,11 +129,11 @@ int AI_Edge_QX_Det::Detect(const cv::Mat &img, cv::Mat &detmask, DetConfig *pDet m_pdetlog = pdetlog; if (pDetConfig->ninstruct == 767) { - // nRuntype = 1; + nRuntype = 1; } else if (pDetConfig->ninstruct == 768) { - // nRuntype = 2; + nRuntype = 2; } bool bdege = false; diff --git a/AlgorithmModule/src/CameraCheckAnalysisy.cpp b/AlgorithmModule/src/CameraCheckAnalysisy.cpp index ada27e9..e1cc4b3 100644 --- a/AlgorithmModule/src/CameraCheckAnalysisy.cpp +++ b/AlgorithmModule/src/CameraCheckAnalysisy.cpp @@ -697,7 +697,13 @@ int CameraCheckAnalysisy::preDet_BQ(const cv::Mat &L255CutImg, std::shared_ptrcameraBaseResult->pBQ_Result = std::make_shared(); m_pCheck_Result->cameraBaseResult->pBQ_Result->bShield_BQ = m_AnalysisyConfig.commonCheckConfig.baseConfig.bShield_BQ; - m_pCheck_Result->cameraBaseResult->pBQ_Result->bBQ_AI_Det = m_pbaseCheckFunction->Det_BQ.bBQ_AI_Det; + + // Det_BQ 已从 Base 层移至 Channel 层 + ChannelCheckFunction *pChannelFuntion_BQ = GetChannelFuntion(L255->strChannel); + if (pChannelFuntion_BQ) + { + m_pCheck_Result->cameraBaseResult->pBQ_Result->bBQ_AI_Det = pChannelFuntion_BQ->function.f_Det_BQ.bBQ_AI_Det; + } cv::Rect Det_CropRoi = m_pCheck_Result->cameraBaseResult->pEdgeDetResult->cutRoi; @@ -726,7 +732,7 @@ int CameraCheckAnalysisy::preDet_BQ(const cv::Mat &L255CutImg, std::shared_ptrcameraBaseResult->pBQ_Result->pBQ_roiList.size(); i++) { cv::Rect boundingRect = m_pCheck_Result->cameraBaseResult->pBQ_Result->pBQ_roiList.at(i); - int BQ_expand = m_pbaseCheckFunction->Det_BQ.BQ_expand; + int BQ_expand = pChannelFuntion_BQ ? pChannelFuntion_BQ->function.f_Det_BQ.BQ_expand : 0; boundingRect.x -= BQ_expand; boundingRect.y -= BQ_expand; boundingRect.width += 2 * BQ_expand; @@ -738,7 +744,7 @@ int CameraCheckAnalysisy::preDet_BQ(const cv::Mat &L255CutImg, std::shared_ptrDet_BQ.bBQ_AI_Det) + if (pChannelFuntion_BQ && pChannelFuntion_BQ->function.f_Det_BQ.bBQ_AI_Det) { m_pCheck_Result->cameraBaseResult->pBQ_Result->pBQ_expandedRoiList.push_back(boundingRect); cv::Mat bqCrop = L255CutImg(boundingRect).clone(); diff --git a/AlgorithmModule/src/ImgCheckAnalysisy.cpp b/AlgorithmModule/src/ImgCheckAnalysisy.cpp index 0ba6454..8cd7cf1 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.3.0_" + std::string(__DATE__) + "_" + std::string(__TIME__)); + return std::string("BOE_1.3.1_" + std::string(__DATE__) + "_" + std::string(__TIME__)); } std::string ImgCheckAnalysisy::GetErrorInfo() diff --git a/ConfigModule/include/CheckConfigDefine.h b/ConfigModule/include/CheckConfigDefine.h index 9d031bc..7411bed 100644 --- a/ConfigModule/include/CheckConfigDefine.h +++ b/ConfigModule/include/CheckConfigDefine.h @@ -1719,6 +1719,41 @@ struct Function_Edge_Det return str123; } }; +struct Function_Det_BQ +{ + bool bBQ_AI_Det; // 是否启用标签独立AI检测 + int BQ_expand; + + Function_Det_BQ() + { + Init(); + } + void Init() + { + BQ_expand = 0; + bBQ_AI_Det = false; + } + void copy(Function_Det_BQ tem) + { + this->BQ_expand = tem.BQ_expand; + this->bBQ_AI_Det = tem.bBQ_AI_Det; + } + void print(std::string str) + { + printf("%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(), + BQ_expand, bBQ_AI_Det); + } + std::string GetInfo(std::string str) + { + char buffer[256]; + sprintf(buffer, "%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(), + BQ_expand, bBQ_AI_Det); + std::string str123 = buffer; + return str123; + } + +}; + // 检测功能 struct CheckFunction { @@ -1738,6 +1773,7 @@ struct CheckFunction Function_AD_Check f_AD_Check; // 暗点的检测功能 Function_POL_Check f_POL_Check; // 异物的检测功能 Function_Edge_Det f_dege_Det; + Function_Det_BQ f_Det_BQ; CheckFunction() { Init(); @@ -1760,6 +1796,7 @@ struct CheckFunction f_AD_Check.Init(); f_POL_Check.Init(); f_dege_Det.Init(); + f_Det_BQ.Init(); } void copy(CheckFunction tem) { @@ -1780,6 +1817,7 @@ struct CheckFunction this->f_AD_Check.copy(tem.f_AD_Check); this->f_POL_Check.copy(tem.f_POL_Check); this->f_dege_Det.copy(tem.f_dege_Det); + this->f_Det_BQ.copy(tem.f_Det_BQ); } void print(std::string str) { @@ -1800,6 +1838,7 @@ struct CheckFunction f_AD_Check.print("f_AD_Check"); f_POL_Check.print("f_POL_Check"); f_dege_Det.print("f_dege_Det"); + f_Det_BQ.print("f_Det_BQ"); } std::string GetInfo(std::string str) { @@ -1821,6 +1860,7 @@ struct CheckFunction str123 += f_AD_Check.GetInfo("f_AD_Check"); str123 += f_POL_Check.GetInfo("f_POL_Check"); str123 += f_dege_Det.GetInfo("f_dege_Det"); + str123 += f_Det_BQ.GetInfo("f_Det_BQ"); return str123; } }; @@ -2261,40 +2301,6 @@ struct Base_Function_AD_Check } }; -struct Base_Function_Det_BQ -{ - int BQ_expand; - bool bBQ_AI_Det; // 是否启用标签独立AI检测,汇入主流程分类 - - Base_Function_Det_BQ() - { - Init(); - } - void Init() - { - BQ_expand = 0; - bBQ_AI_Det = false; - } - void copy(Base_Function_Det_BQ tem) - { - this->BQ_expand = tem.BQ_expand; - this->bBQ_AI_Det = tem.bBQ_AI_Det; - } - void print(std::string str) - { - printf("%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(), - BQ_expand, bBQ_AI_Det); - } - std::string GetInfo(std::string str) - { - char buffer[256]; - sprintf(buffer, "%d BQ_expand %d bBQ_AI_Det %d\n", str.c_str(), - BQ_expand, bBQ_AI_Det); - std::string str123 = buffer; - return str123; - } - -}; // 基础检测功能 struct BaseCheckFunction { @@ -2304,7 +2310,6 @@ struct BaseCheckFunction Base_Function_BigNG bigNG; Base_Function_EdgeChannel edgeChannel; Base_Function_AD_Check ad_check; - Base_Function_Det_BQ Det_BQ; BaseCheckFunction() { Init(); @@ -2317,7 +2322,6 @@ struct BaseCheckFunction bigNG.Init(); edgeChannel.Init(); ad_check.Init(); - Det_BQ.Init(); } void copy(BaseCheckFunction tem) { @@ -2327,7 +2331,6 @@ struct BaseCheckFunction this->bigNG.copy(tem.bigNG); this->edgeChannel.copy(tem.edgeChannel); this->ad_check.copy(tem.ad_check); - this->Det_BQ.copy(tem.Det_BQ); } void print(std::string str) { @@ -2338,7 +2341,6 @@ struct BaseCheckFunction bigNG.print("bigNG"); edgeChannel.print("edgeChannel"); ad_check.print("ad_check"); - Det_BQ.print("Det_BQ"); } std::string GetInfo(std::string str) { @@ -2349,7 +2351,6 @@ struct BaseCheckFunction str123 += bigNG.GetInfo("bigNG"); str123 += edgeChannel.GetInfo("edgeChannel"); str123 += ad_check.GetInfo("ad_check"); - str123 += Det_BQ.GetInfo("Det_BQ"); // str123 += "\n"; return str123; } diff --git a/ConfigModule/src/JsonConfig.cpp b/ConfigModule/src/JsonConfig.cpp index ba11b73..7237ac6 100644 --- a/ConfigModule/src/JsonConfig.cpp +++ b/ConfigModule/src/JsonConfig.cpp @@ -1111,6 +1111,20 @@ int ChannelFuntonConfigJson::GetFunction(Json::Value value, CheckFunction &funct // function.f_markDet.print("UpQX"); // getchar(); } + // 标签配置参数 + if ("Det_BQ" == strCode) + { + auto value_f = value; + // std::cout << value_f << std::endl; + // getchar(); + function.f_Det_BQ.bBQ_AI_Det = value_f["isOpen"].asBool(); + { + if (value_f["form"]["BQ_Param"]["BQ_expand"]) + { + function.f_Det_BQ.BQ_expand = value_f["form"]["BQ_Param"]["BQ_expand"].asInt(); + } + } + } } } return 0; @@ -1471,21 +1485,5 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value) _config.ad_check.Init(); } } - // 标签配置参数 - if ("Det_BQ" == strCode) - { - auto value_f = value; - // std::cout << value_f << std::endl; - // getchar(); - _config.Det_BQ.bBQ_AI_Det = value_f["isOpen"].asBool(); - { - if (value_f["form"]["bShield_BQ"]["BQ_expand"]) - { - _config.Det_BQ.BQ_expand = value_f["form"]["bShield_BQ"]["BQ_expand"].asInt(); - } - } - // _config.edgeDet.print("edgeDet"); - // getchar(); - } return 0; }