From 026060fa5f184181ff22545de7bca6c96805b466 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Wed, 15 Jul 2026 15:16:11 +0800 Subject: [PATCH] =?UTF-8?q?update=20area=E5=92=8Chj=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgorithmModule/src/ImageResultJudge.cpp | 16 +++++++++++++++- ConfigModule/include/CheckConfigDefine.h | 3 +++ ConfigModule/src/JsonConfig.cpp | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/AlgorithmModule/src/ImageResultJudge.cpp b/AlgorithmModule/src/ImageResultJudge.cpp index 6c782cb..10e60a6 100644 --- a/AlgorithmModule/src/ImageResultJudge.cpp +++ b/AlgorithmModule/src/ImageResultJudge.cpp @@ -325,6 +325,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) float At = pParam->paramArr[j].area; float Et = pParam->paramArr[j].energy; float hj = pParam->paramArr[j].hj; + float hj_max = pParam->paramArr[j].hj_max; float Len = pParam->paramArr[j].length; float md = pParam->paramArr[j].density; float area_max = pParam->paramArr[j].area_max; @@ -386,7 +387,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) BOOL_TO_STR(flen >= Len), flen, BOOL_TO_ThanLess(flen > Len), Len); } - if( config_qx_type == CONFIG_QX_NAME_POL_Cell && area_max > 0) + if(area_max > 0) { if(detArea > area_max) { @@ -399,6 +400,19 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) BOOL_TO_STR(detArea > area_max), detArea, BOOL_TO_ThanLess(detArea > area_max), area_max); } + if(hj_max > 0) + { + if(grayDis > hj_max) + { + nerrortype = 0; + result = true; + bNG_Status = false; + bYS_Status = false; + } + pQxLog->AddCheckstr(PrintLevel_4, DET_LOG_LEVEL_3, "PolCell_HJ_Max", "%s -> %f %s %f ", + BOOL_TO_STR(grayDis > hj_max), grayDis, BOOL_TO_ThanLess(grayDis > hj_max), hj_max); + } + if (!result) { break; diff --git a/ConfigModule/include/CheckConfigDefine.h b/ConfigModule/include/CheckConfigDefine.h index 9d031bc..15fa3c3 100644 --- a/ConfigModule/include/CheckConfigDefine.h +++ b/ConfigModule/include/CheckConfigDefine.h @@ -328,6 +328,7 @@ struct AandEParam float area_max; // 面积上限 float energy; // 能量 float hj; // 灰阶 + float hj_max; // 灰阶上限 float length; // 长度 int num; // 数量 float dis; // 距离 @@ -340,6 +341,7 @@ struct AandEParam area_max = -1; energy = -1; hj = -1; + hj_max = -1; length = -1; num = -1; dis = -1; @@ -357,6 +359,7 @@ struct AandEParam this->area_max = tem.area_max; this->energy = tem.energy; this->hj = tem.hj; + this->hj_max = tem.hj_max; this->length = tem.length; this->num = tem.num; this->dis = tem.dis; diff --git a/ConfigModule/src/JsonConfig.cpp b/ConfigModule/src/JsonConfig.cpp index ba11b73..dea8864 100644 --- a/ConfigModule/src/JsonConfig.cpp +++ b/ConfigModule/src/JsonConfig.cpp @@ -226,6 +226,11 @@ void CommonParamToCheckConfigJson::toObjectFromValue(Json::Value root) temparam.hj = value_node_imgs_region_Check_Param_value[idx]["hj"].asFloat(); } + if (value_node_imgs_region_Check_Param_value[idx]["hj_max"]) + { + temparam.hj_max = value_node_imgs_region_Check_Param_value[idx]["hj_max"].asFloat(); + } + if (value_node_imgs_region_Check_Param_value[idx]["length"]) { temparam.length = value_node_imgs_region_Check_Param_value[idx]["length"].asFloat();