From e80cae3e6047dcb97125081d41bf2df3164dbc52 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Tue, 27 Oct 2026 17:19:38 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E6=B7=BB=E5=8A=A0=E7=9B=B2=E5=A4=B1?= =?UTF-8?q?=EF=BC=8C=E9=BB=91=E7=99=BD=E7=82=B9=E8=BF=87=E6=BB=A4=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ConfigModule/include/CheckConfigDefine.h | 114 +++++++++++++++++++++++ ConfigModule/src/JsonConfig.cpp | 85 +++++++++++++++++ 2 files changed, 199 insertions(+) diff --git a/ConfigModule/include/CheckConfigDefine.h b/ConfigModule/include/CheckConfigDefine.h index 8f51eea..a30f782 100644 --- a/ConfigModule/include/CheckConfigDefine.h +++ b/ConfigModule/include/CheckConfigDefine.h @@ -2374,6 +2374,110 @@ struct Base_Function_AD_Check } }; +// 盲失检测功能 +struct Base_Function_MS_Check +{ + + bool bOpen; // 是否开启 + float MS_IOU; // IOU 阈值(同位置判断) + float MS_Expand; // 扩张值(像素) + std::vector ms_main_channel; // 主通道绑定 + std::vector ms_filter_channels; // 过滤通道绑定 + + Base_Function_MS_Check() + { + Init(); + } + void Init() + { + bOpen = false; + MS_IOU = 0.8f; + MS_Expand = 0.0f; + ms_main_channel.clear(); + ms_filter_channels.clear(); + } + + void copy(Base_Function_MS_Check tem) + { + this->bOpen = tem.bOpen; + this->MS_IOU = tem.MS_IOU; + this->MS_Expand = tem.MS_Expand; + this->ms_main_channel = tem.ms_main_channel; + this->ms_filter_channels = tem.ms_filter_channels; + } + void print(std::string str) + { + printf("%s", GetInfo(str).c_str()); + } + std::string GetInfo(std::string str) + { + char buffer[256]; + sprintf(buffer, "%s>>bOpen %d MS_IOU %f MS_Expand %f ", str.c_str(), bOpen, MS_IOU, MS_Expand); + std::string str123 = buffer; + for (int i = 0; i < ms_main_channel.size(); i++) + { + str123 += str + ":ms_main_channel " + ms_main_channel.at(i) + ";"; + } + for (int i = 0; i < ms_filter_channels.size(); i++) + { + str123 += str + ":ms_filter_channels " + ms_filter_channels.at(i) + ";"; + } + str123 += "\n"; + return str123; + } +}; + +// Cell黑白点检测功能 +struct Base_Function_CellBW_Check +{ + bool bOpen; // 是否开启 + float CellBW_IOU; // IOU 阈值(同位置判断) + float CellBW_Expand; // 扩张值(像素) + std::vector cellbw_main_channel; // 主通道绑定 + std::vector cellbw_filter_channels; // 过滤通道绑定 + + Base_Function_CellBW_Check() + { + Init(); + } + void Init() + { + bOpen = false; + CellBW_IOU = 0.8f; + CellBW_Expand = 0.0f; + cellbw_main_channel.clear(); + cellbw_filter_channels.clear(); + } + void copy(Base_Function_CellBW_Check tem) + { + this->bOpen = tem.bOpen; + this->CellBW_IOU = tem.CellBW_IOU; + this->CellBW_Expand = tem.CellBW_Expand; + this->cellbw_main_channel = tem.cellbw_main_channel; + this->cellbw_filter_channels = tem.cellbw_filter_channels; + } + void print(std::string str) + { + printf("%s", GetInfo(str).c_str()); + } + std::string GetInfo(std::string str) + { + char buffer[256]; + sprintf(buffer, "%s>>bOpen %d CellBW_IOU %f CellBW_Expand %f ", str.c_str(), bOpen, CellBW_IOU, CellBW_Expand); + std::string str123 = buffer; + for (int i = 0; i < cellbw_main_channel.size(); i++) + { + str123 += str + ":cellbw_main_channel " + cellbw_main_channel.at(i) + ";"; + } + for (int i = 0; i < cellbw_filter_channels.size(); i++) + { + str123 += str + ":cellbw_filter_channels " + cellbw_filter_channels.at(i) + ";"; + } + str123 += "\n"; + return str123; + } +}; + // 基础检测功能 struct BaseCheckFunction { @@ -2383,6 +2487,8 @@ struct BaseCheckFunction Base_Function_BigNG bigNG; Base_Function_EdgeChannel edgeChannel; Base_Function_AD_Check ad_check; + Base_Function_MS_Check ms_check; + Base_Function_CellBW_Check cellbw_check; bool bDrawAndSave; // 是否存图绘制(绘制并保存结果图,运行时替代 SAVE_RESIMG 宏) BaseCheckFunction() { @@ -2396,6 +2502,8 @@ struct BaseCheckFunction bigNG.Init(); edgeChannel.Init(); ad_check.Init(); + ms_check.Init(); + cellbw_check.Init(); bDrawAndSave = false; } void copy(BaseCheckFunction tem) @@ -2406,6 +2514,8 @@ struct BaseCheckFunction this->bigNG.copy(tem.bigNG); this->edgeChannel.copy(tem.edgeChannel); this->ad_check.copy(tem.ad_check); + this->ms_check.copy(tem.ms_check); + this->cellbw_check.copy(tem.cellbw_check); this->bDrawAndSave = tem.bDrawAndSave; } void print(std::string str) @@ -2417,6 +2527,8 @@ struct BaseCheckFunction bigNG.print("bigNG"); edgeChannel.print("edgeChannel"); ad_check.print("ad_check"); + ms_check.print("ms_check"); + cellbw_check.print("cellbw_check"); printf("bDrawAndSave %d\n", bDrawAndSave); } std::string GetInfo(std::string str) @@ -2428,6 +2540,8 @@ struct BaseCheckFunction str123 += bigNG.GetInfo("bigNG"); str123 += edgeChannel.GetInfo("edgeChannel"); str123 += ad_check.GetInfo("ad_check"); + str123 += ms_check.GetInfo("ms_check"); + str123 += cellbw_check.GetInfo("cellbw_check"); // str123 += "\n"; return str123; } diff --git a/ConfigModule/src/JsonConfig.cpp b/ConfigModule/src/JsonConfig.cpp index 4ff0544..c0b4b18 100644 --- a/ConfigModule/src/JsonConfig.cpp +++ b/ConfigModule/src/JsonConfig.cpp @@ -1542,6 +1542,91 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value) { _config.bDrawAndSave = value["isOpen"].asBool(); } + // 盲失分析(code绑定的qx_Other) + if ("MS_Analysis" == strCode) + { + auto value_f = value; + // std::cout << value_f << std::endl; + _config.ms_check.bOpen = value_f["isOpen"].asBool(); + if (_config.ms_check.bOpen) + { + // IOU分析 + if (value_f["form"]["MS_Check_Param"]["ms_iou"]) + { + _config.ms_check.MS_IOU = value_f["form"]["MS_Check_Param"]["ms_iou"].asFloat(); + } + if (value_f["form"]["MS_Check_Param"]["ms_expand"]) + { + _config.ms_check.MS_Expand = value_f["form"]["MS_Check_Param"]["ms_expand"].asFloat(); + } + // 通道绑定 + auto value_qx = value_f["form"]["MS_Check_Param"]["ms_main_channels"]; + if (value_qx.isArray()) + { + for (int idx = 0; idx < value_qx.size(); idx++) + { + std::string channel = value_qx[idx].asString(); + _config.ms_check.ms_main_channel.push_back(channel); + } + } + value_qx = value_f["form"]["MS_Check_Param"]["ms_filter_channels"]; + if (value_qx.isArray()) + { + for (int idx = 0; idx < value_qx.size(); idx++) + { + std::string channel = value_qx[idx].asString(); + _config.ms_check.ms_filter_channels.push_back(channel); + } + } + } + else + { + _config.ms_check.Init(); + } + } + // Cell黑白点分析(code绑定的qx_Other) + if ("Cellbw_Analysis" == strCode) + { + auto value_f = value; + // std::cout << value_f << std::endl; + _config.cellbw_check.bOpen = value_f["isOpen"].asBool(); + if (_config.cellbw_check.bOpen) + { + // IOU分析 + if (value_f["form"]["CellBW_Check_Param"]["cellbw_iou"]) + { + _config.cellbw_check.CellBW_IOU = value_f["form"]["CellBW_Check_Param"]["cellbw_iou"].asFloat(); + } + if (value_f["form"]["CellBW_Check_Param"]["cellbw_expand"]) + { + _config.cellbw_check.CellBW_Expand = value_f["form"]["CellBW_Check_Param"]["cellbw_expand"].asFloat(); + } + + // 通道绑定 + auto value_qx = value_f["form"]["CellBW_Check_Param"]["cellbw_main_channels"]; + if (value_qx.isArray()) + { + for (int idx = 0; idx < value_qx.size(); idx++) + { + std::string channel = value_qx[idx].asString(); + _config.cellbw_check.cellbw_main_channel.push_back(channel); + } + } + value_qx = value_f["form"]["CellBW_Check_Param"]["cellbw_filter_channels"]; + if (value_qx.isArray()) + { + for (int idx = 0; idx < value_qx.size(); idx++) + { + std::string channel = value_qx[idx].asString(); + _config.cellbw_check.cellbw_filter_channels.push_back(channel); + } + } + } + else + { + _config.cellbw_check.Init(); + } + } return 0; }