feat YX添加面积过滤YS

dev_lsy
liusiyang 1 week ago
parent 73193e70dd
commit 38a9739b7d

@ -439,7 +439,7 @@ int ImageResultJudge::ResultJudge(std::shared_ptr<ImageAllResult> 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<ImageAllResult> 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<ImageAllResult> 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<ImageAllResult> 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;

@ -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;
}

@ -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");
}

Loading…
Cancel
Save