From 38a9739b7d9c38d5cc77c9c43adc55c98ce2794f Mon Sep 17 00:00:00 2001 From: liusiyang Date: Thu, 30 Jul 2026 16:45:33 +0800 Subject: [PATCH] =?UTF-8?q?feat=20YX=E6=B7=BB=E5=8A=A0=E9=9D=A2=E7=A7=AF?= =?UTF-8?q?=E8=BF=87=E6=BB=A4YS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgorithmModule/src/ImageResultJudge.cpp | 17 ++++++++++++++--- ConfigModule/include/CheckConfigDefine.h | 7 +++++-- ConfigModule/src/JsonConfig.cpp | 4 ++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/AlgorithmModule/src/ImageResultJudge.cpp b/AlgorithmModule/src/ImageResultJudge.cpp index 81c73d4..211dd2b 100644 --- a/AlgorithmModule/src/ImageResultJudge.cpp +++ b/AlgorithmModule/src/ImageResultJudge.cpp @@ -439,7 +439,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) // pFuntion->function.f_AD_Check.analysis_s.bOpen && // pFuntion->function.f_AD_Check.analysis_s.NG_3s && bpreSucc) if ((nerrortype == 0 || checkFlage != ANALYSIS_TYPE_TF) && - config_qx_type == CONFIG_QX_NAME_AD && m_pbaseCheckFunction && + config_qx_type == CONFIG_QX_NAME_AD && pFuntion != NULL && m_pbaseCheckFunction && m_pbaseCheckFunction->ad_check.bOpen && m_pbaseCheckFunction->ad_check.analysis_s.bOpen && m_pbaseCheckFunction->ad_check.analysis_s.NG_3s && bpreSucc) @@ -494,7 +494,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) { // 目前为止判断是好品 - if (!bNG_Status && pFuntion->function.f_Big_QX.bOpen) + if (!bNG_Status && pFuntion != NULL && pFuntion->function.f_Big_QX.bOpen) { Judge_Status = true; bool berror = false; @@ -518,7 +518,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) } // 总面积判断 - if (!bNG_Status && pFuntion->function.f_Big_QX.bOpen) + if (!bNG_Status && pFuntion != NULL && pFuntion->function.f_Big_QX.bOpen) { if (nSumBLobNUm <= pFuntion->function.f_Big_QX.Sum_blob_Num) { @@ -565,6 +565,17 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) pQxLog->AddCheckstr(PrintLevel_2, DET_LOG_LEVEL_3, " big qx ", "qx %s ,result = %s", qx_name.c_str(), resultType.c_str()); } + // 对于 AD_YX 类型,面积小于设定值的 降级为NoJudge + if (config_qx_type == CONFIG_QX_NAME_AD_YX && bYS_Status && pFuntion != NULL && + pFuntion->function.f_YXDet.bOpen && JudgArea < pFuntion->function.f_YXDet.minArea) + { + bYS_Status = false; + QX_info->result = QX_RESULT_TYPE_OK; + QX_info->result_name = QX_RESULT_TYPE_Names[QX_info->result]; + resultType = QX_info->result_name; + pQxLog->AddCheckstr(PrintLevel_2, DET_LOG_LEVEL_3, "AD_YX downgrade", "area %f < %d, YS -> OK", JudgArea, pFuntion->function.f_YXDet.minArea); + } + if (bNG_Status) { m_CheckResult_shareP->nresult = 1; diff --git a/ConfigModule/include/CheckConfigDefine.h b/ConfigModule/include/CheckConfigDefine.h index 30a6399..4e0f4d1 100644 --- a/ConfigModule/include/CheckConfigDefine.h +++ b/ConfigModule/include/CheckConfigDefine.h @@ -795,6 +795,7 @@ struct Function_YXDet { bool bOpen; // 是否开启 std::string strModle; + int minArea; Function_YXDet() { Init(); @@ -803,20 +804,22 @@ struct Function_YXDet { bOpen = false; strModle = ""; + minArea = 0; } void copy(Function_YXDet tem) { this->bOpen = tem.bOpen; this->strModle = tem.strModle; + this->minArea = tem.minArea; } void print(std::string str) { - // printf("%s>>bOpen %d strModle %s\n", str.c_str(), bOpen, strModle.c_str()); + // printf("%s>>bOpen %d strModle %s minArea %d\n", str.c_str(), bOpen, strModle.c_str(), minArea); } std::string GetInfo(std::string str) { char buffer[64]; - sprintf(buffer, "%s>>bOpen %d strModle %s\n", str.c_str(), bOpen, strModle.c_str()); + sprintf(buffer, "%s>>bOpen %d strModle %s minArea %d\n", str.c_str(), bOpen, strModle.c_str(), minArea); std::string str123 = buffer; return str123; } diff --git a/ConfigModule/src/JsonConfig.cpp b/ConfigModule/src/JsonConfig.cpp index ba772e9..400de61 100644 --- a/ConfigModule/src/JsonConfig.cpp +++ b/ConfigModule/src/JsonConfig.cpp @@ -534,6 +534,10 @@ int ChannelFuntonConfigJson::GetFunction(Json::Value value, CheckFunction &funct { function.f_YXDet.strModle = value_f["form"]["YX_Det"]["AI_Model"].asString(); } + if (value_f["form"]["YX_Det"]["minArea"]) + { + function.f_YXDet.minArea = value_f["form"]["YX_Det"]["minArea"].asInt(); + } // function.f_UseUpQX.print("UpQX"); }