feat 添加区域1和s参数选择通道分析

dev_lsy
liusiyang 2 months ago
parent 4aa7b7feb3
commit 584daf6e0b

@ -398,6 +398,18 @@ int ImageResultJudge::ResultJudge(std::shared_ptr<ImageAllResult> pImageResult)
pQxLog->AddCheckstr(PrintLevel_4, DET_LOG_LEVEL_3, "PolCell_Area_Max", "%s -> %f %s %f ",
BOOL_TO_STR(detArea > area_max), detArea, BOOL_TO_ThanLess(detArea > area_max), area_max);
}
// AD根据配置检测:未配置通道的AD缺陷不判NG
if (config_qx_type == CONFIG_QX_NAME_AD && m_pbaseCheckFunction && ict == ANALYSIS_TYPE_TF &&
std::find(m_pbaseCheckFunction->ad_check.analysis_sf.region_sf.begin(),
m_pbaseCheckFunction->ad_check.analysis_sf.region_sf.end(),
strChannel) == m_pbaseCheckFunction->ad_check.analysis_sf.region_sf.end())
{
nerrortype = 0;
result = true;
bNG_Status = false;
bYS_Status = false;
pQxLog->AddCheckstr(PrintLevel_2, DET_LOG_LEVEL_3, "Param Judge", "AD channel %s not configured in region_sf", strChannel.c_str());
}
if (!result)
{
@ -439,10 +451,15 @@ int ImageResultJudge::ResultJudge(std::shared_ptr<ImageAllResult> pImageResult)
m_pbaseCheckFunction->ad_check.analysis_s.bOpen &&
m_pbaseCheckFunction->ad_check.analysis_s.NG_3s && bpreSucc)
{
bool b3sChannel = false;
if(std::find(m_pbaseCheckFunction->ad_check.analysis_sf.s_sf.begin(), m_pbaseCheckFunction->ad_check.analysis_sf.s_sf.end(), strChannel) != m_pbaseCheckFunction->ad_check.analysis_sf.s_sf.end())
{
b3sChannel = true;
}
Judge_Status = true;
int det_s_Vale = 0;
if (JudgArea >= m_pbaseCheckFunction->ad_check.S_standard_3s.area &&
flen >= m_pbaseCheckFunction->ad_check.S_standard_3s.len && (strChannel == "L127" || strChannel == "L255"))
flen >= m_pbaseCheckFunction->ad_check.S_standard_3s.len && b3sChannel)
{
nerrortype = 1;
checkFlage = ANALYSIS_TYPE_TF;

@ -170,7 +170,7 @@ int ImgCheckAnalysisy::GetStatus()
std::string ImgCheckAnalysisy::GetVersion()
{
return std::string("BOE_1.3.6_" + std::string(__DATE__) + "_" + std::string(__TIME__));
return std::string("BOE_1.3.7_" + std::string(__DATE__) + "_" + std::string(__TIME__));
}
std::string ImgCheckAnalysisy::GetErrorInfo()

@ -1605,6 +1605,39 @@ struct AD_Analysisy_Bind
}
};
struct AD_Analysisy_SF
{
std::vector<std::string> s_sf;
std::vector<std::string> region_sf;
AD_Analysisy_SF()
{
Init();
}
void Init()
{
s_sf.clear();
region_sf.clear();
}
void copy (AD_Analysisy_SF tem)
{
this->s_sf = tem.s_sf;
this->region_sf = tem.region_sf;
}
std::string GetInfo(std::string str)
{
std::string str123;
for (int i = 0; i < s_sf.size(); i++)
{
str123 += str + ":s_sf " + s_sf[i] + ";";
}
for (int i = 0; i < region_sf.size(); i++)
{
str123 += str + ":region_sf " + region_sf[i] + ";";
}
return str123;
}
};
// 异物检测功能
struct Function_POL_Check
{
@ -2218,6 +2251,7 @@ struct Base_Function_AD_Check
AD_Analysisy_S analysis_s; // s 标准分析
AD_Analysisy_IOU analysis_iou; // IOU 分析
AD_Analysisy_Bind analysis_bind; // 绑定分析
AD_Analysisy_SF analysis_sf; // 同画面参数分析
Base_Function_AD_Check()
@ -2235,6 +2269,7 @@ struct Base_Function_AD_Check
analysis_s.Init();
analysis_iou.Init();
analysis_bind.Init();
analysis_sf.Init();
}
void copy(Base_Function_AD_Check tem)
@ -2248,18 +2283,20 @@ struct Base_Function_AD_Check
this->analysis_s.copy(tem.analysis_s);
this->analysis_iou.copy(tem.analysis_iou);
this->analysis_bind.copy(tem.analysis_bind);
this->analysis_sf.copy(tem.analysis_sf);
}
void print(std::string str)
{
printf("%s>>bOpen %d %s %s %s %s %s %s %s\n", str.c_str(),
printf("%s>>bOpen %d %s %s %s %s %s %s %s %s %s\n", str.c_str(),
bOpen, S_standard_3s.GetInfo("3S").c_str(),
S_standard_2s.GetInfo("2S").c_str(),
S_standard_1s.GetInfo("1S").c_str(),
analysis_num.GetInfo("analysis_num").c_str(),
analysis_dis.GetInfo("analysis_dis").c_str(),
analysis_s.GetInfo("analysis_s").c_str(),
analysis_iou.GetInfo("analysis_iou").c_str()),
analysis_bind.GetInfo("analysis_bind").c_str();
analysis_iou.GetInfo("analysis_iou").c_str(),
analysis_bind.GetInfo("analysis_bind").c_str(),
analysis_sf.GetInfo("analysis_sf").c_str());
}
std::string GetInfo(std::string str)
{
@ -2274,6 +2311,7 @@ struct Base_Function_AD_Check
str123 += analysis_s.GetInfo("analysis_s");
str123 += analysis_iou.GetInfo("analysis_iou");
str123 += analysis_bind.GetInfo("analysis_time");
str123 += analysis_sf.GetInfo("analysis_sf");
return str123;
}

@ -1472,6 +1472,25 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value)
}
}
// 同画面分析
value_qx = value_f["form"]["Single_Channel"]["s_channel"];
if (value_qx.isArray())
{
for (int idx = 0; idx < value_qx.size(); idx++)
{
std::string channel = value_qx[idx].asString();
_config.ad_check.analysis_sf.s_sf.push_back(channel);
}
}
value_qx = value_f["form"]["Single_Channel"]["region1_channel"];
if (value_qx.isArray())
{
for (int idx = 0; idx < value_qx.size(); idx++)
{
std::string channel = value_qx[idx].asString();
_config.ad_check.analysis_sf.region_sf.push_back(channel);
}
}
}
else
{

Loading…
Cancel
Save