|
|
|
|
@ -815,7 +815,9 @@ int ImgCheckAnalysisy::CheckRun()
|
|
|
|
|
long handle_e = CheckUtil::getcurTime();
|
|
|
|
|
m_pdetlog->AddCheckstr(PrintLevel_1, DET_LOG_LEVEL_3, "Handle", "handle detect use time %ld", handle_e - handle_s);
|
|
|
|
|
}
|
|
|
|
|
// 标签检测(独立步骤):暗场图像 + 明场 bigmask(不再沿用明场检出的标签)
|
|
|
|
|
// 标签检测(独立步骤):暗场图像 + 明场 bigmask(不再沿用明场检出的标签);bDetTag 关闭时跳过
|
|
|
|
|
{
|
|
|
|
|
if (m_pFuntion->function.f_supportDet.bDetTag)
|
|
|
|
|
{
|
|
|
|
|
long tag_s = CheckUtil::getcurTime();
|
|
|
|
|
int reTag = CheckTagByBigMask(m_CheckResult_shareP->in_shareImage->img, m_pEdge_Align_Result->bigmask);
|
|
|
|
|
@ -829,6 +831,12 @@ int ImgCheckAnalysisy::CheckRun()
|
|
|
|
|
return m_nErrorCode;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
m_tag_roiList.clear();
|
|
|
|
|
m_pdetlog->AddCheckstr(PrintLevel_1, DET_LOG_LEVEL_3, "Tag", "bDetTag close, skip tag detect");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ -949,10 +957,11 @@ int ImgCheckAnalysisy::CheckRun()
|
|
|
|
|
|
|
|
|
|
m_pdetlog->AddCheckstr(PrintLevel_0, "3、pre detect", "-------------------------pre Det--------------- \n");
|
|
|
|
|
|
|
|
|
|
/* 检测支架偏移 */
|
|
|
|
|
/* 检测支架偏移(bDetSupport 开关关闭时不做支架判定) */
|
|
|
|
|
{
|
|
|
|
|
Function_Support_Det &supportDet = m_pFuntion->function.f_supportDet;
|
|
|
|
|
if (supportDet.bOpen && supportDet.supportRect.size.width > 0 && supportDet.supportRect.size.height > 0)
|
|
|
|
|
if (supportDet.bOpen && supportDet.bDetSupport &&
|
|
|
|
|
supportDet.supportRect.size.width > 0 && supportDet.supportRect.size.height > 0)
|
|
|
|
|
{
|
|
|
|
|
cv::RotatedRect &inner = m_inner_rroi;
|
|
|
|
|
cv::RotatedRect &support = supportDet.supportRect;
|
|
|
|
|
@ -1089,8 +1098,12 @@ int ImgCheckAnalysisy::CheckRun()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Tag检测 */
|
|
|
|
|
/* Tag检测(bDetTag 关闭时不上报标签 NG) */
|
|
|
|
|
{
|
|
|
|
|
if (!m_pFuntion->function.f_supportDet.bDetTag)
|
|
|
|
|
{
|
|
|
|
|
m_tag_roiList.clear();
|
|
|
|
|
}
|
|
|
|
|
for (const auto &tagRoi : m_tag_roiList)
|
|
|
|
|
{
|
|
|
|
|
// tag roi 在原图坐标系,按摆正仿射转换到检测图(detImg)坐标系
|
|
|
|
|
@ -2529,6 +2542,7 @@ int ImgCheckAnalysisy::AI_Edge(const cv::Mat &img, cv::RotatedRect &outerRoi, cv
|
|
|
|
|
}
|
|
|
|
|
config.strChannel = DetImgInfo_shareP->strChannel;
|
|
|
|
|
config.pBaseCheckFunction = m_pbaseCheckFunction;
|
|
|
|
|
config.bDetTag = m_pFuntion->function.f_supportDet.bDetTag; // 标签检测开关:关闭时不跑 Tag_Loc
|
|
|
|
|
|
|
|
|
|
/* 定位获取三个roi */
|
|
|
|
|
int re = m_pAI_Edge_Algin.Detect(img, &config, m_pEdge_Align_Result);
|
|
|
|
|
@ -2544,10 +2558,8 @@ int ImgCheckAnalysisy::AI_Edge(const cv::Mat &img, cv::RotatedRect &outerRoi, cv
|
|
|
|
|
{
|
|
|
|
|
innerRoi = m_pEdge_Align_Result->smallroi[0];
|
|
|
|
|
}
|
|
|
|
|
if (!m_pEdge_Align_Result->tagroi.empty())
|
|
|
|
|
{
|
|
|
|
|
// 无条件赋值:Tag_Loc 未检出或 bDetTag 关闭(tagroi 为空)时清空,避免残留上一张图的标签
|
|
|
|
|
tagroiList = m_pEdge_Align_Result->tagroi;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*使用m_pEdge_Align_Result->bigmask检测把手是否缺失*/
|
|
|
|
|
{
|
|
|
|
|
|