feat 开放标签扩/缩参数

dev_heyuan
liusiyang 1 month ago
parent 8610481adb
commit eb2cf825ce

@ -718,19 +718,24 @@ int CameraCheckAnalysisy::preDet_BQ(const cv::Mat &L255CutImg, std::shared_ptr<I
}
// 如果要屏蔽标签
if (m_pCheck_Result->cameraBaseResult->pBQ_Result->bShield_BQ)
if (m_pCheck_Result->cameraBaseResult->pBQ_Result->bShield_BQ && m_pbaseCheckFunction->Det_BQ.bOpen)
{
m_pdetlog->AddCheckstr(PrintLevel_2, "preDet_BQ", "shieldBQ is Open");
cv::Mat detImg_mask = m_pCheck_Result->cameraBaseResult->pEdgeDetResult->shieldMask;
for (int i = 0; i < m_pCheck_Result->cameraBaseResult->pBQ_Result->pBQ_roiList.size(); i++)
{
cv::Rect boundingRect = m_pCheck_Result->cameraBaseResult->pBQ_Result->pBQ_roiList.at(i);
boundingRect.x -= 5;
boundingRect.y -= 5;
boundingRect.width += 10;
boundingRect.height += 10;
int BQ_expand = m_pbaseCheckFunction->Det_BQ.BQ_expand;
boundingRect.x -= BQ_expand;
boundingRect.y -= BQ_expand;
boundingRect.width += 2 * BQ_expand;
boundingRect.height += 2 * BQ_expand;
boundingRect = boundingRect & cv::Rect(0, 0, detImg_mask.cols, detImg_mask.rows);
if (boundingRect.width > 0 && boundingRect.height > 0)
{
detImg_mask(boundingRect).setTo(255);
}
}
if (L255->result->in_shareImage->bDebugsaveImg)
{
cv::imwrite("sheildImg.png", m_pCheck_Result->cameraBaseResult->pEdgeDetResult->shieldMask);

@ -2261,6 +2261,40 @@ struct Base_Function_AD_Check
}
};
struct Base_Function_Det_BQ
{
bool bOpen;
int BQ_expand;
Base_Function_Det_BQ()
{
Init();
}
void Init()
{
bOpen = false;
BQ_expand = 0;
}
void copy(Base_Function_Det_BQ tem)
{
this->bOpen = tem.bOpen;
this->BQ_expand = tem.BQ_expand;
}
void print(std::string str)
{
printf("%s>>bOpen %d BQ_expand %d\n", str.c_str(),
bOpen, BQ_expand);
}
std::string GetInfo(std::string str)
{
char buffer[256];
sprintf(buffer, "%s>>bOpen %d BQ_expand %d\n", str.c_str(),
bOpen, BQ_expand);
std::string str123 = buffer;
return str123;
}
};
// 基础检测功能
struct BaseCheckFunction
{
@ -2270,6 +2304,7 @@ struct BaseCheckFunction
Base_Function_BigNG bigNG;
Base_Function_EdgeChannel edgeChannel;
Base_Function_AD_Check ad_check;
Base_Function_Det_BQ Det_BQ;
BaseCheckFunction()
{
Init();
@ -2282,6 +2317,7 @@ struct BaseCheckFunction
bigNG.Init();
edgeChannel.Init();
ad_check.Init();
Det_BQ.Init();
}
void copy(BaseCheckFunction tem)
{
@ -2291,6 +2327,7 @@ struct BaseCheckFunction
this->bigNG.copy(tem.bigNG);
this->edgeChannel.copy(tem.edgeChannel);
this->ad_check.copy(tem.ad_check);
this->Det_BQ.copy(tem.Det_BQ);
}
void print(std::string str)
{
@ -2301,6 +2338,7 @@ struct BaseCheckFunction
bigNG.print("bigNG");
edgeChannel.print("edgeChannel");
ad_check.print("ad_check");
Det_BQ.print("Det_BQ");
}
std::string GetInfo(std::string str)
{
@ -2311,6 +2349,7 @@ struct BaseCheckFunction
str123 += bigNG.GetInfo("bigNG");
str123 += edgeChannel.GetInfo("edgeChannel");
str123 += ad_check.GetInfo("ad_check");
str123 += Det_BQ.GetInfo("Det_BQ");
// str123 += "\n";
return str123;
}

@ -1471,6 +1471,26 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value)
_config.ad_check.Init();
}
}
// 标签配置参数
if ("Det_BQ" == strCode)
{
auto value_f = value;
// std::cout << value_f << std::endl;
// getchar();
_config.Det_BQ.bOpen = value_f["isOpen"].asBool();
if (_config.Det_BQ.bOpen)
{
if (value_f["form"]["bShield_BQ"]["BQ_expand"])
{
_config.Det_BQ.BQ_expand = value_f["form"]["bShield_BQ"]["BQ_expand"].asInt();
}
}
else
{
_config.Det_BQ.Init();
}
// _config.edgeDet.print("edgeDet");
// getchar();
}
return 0;
}

Loading…
Cancel
Save