|
|
|
|
@ -527,8 +527,8 @@ int ImgCheckAnalysisy::CheckRun()
|
|
|
|
|
alignErr.flen = tplRect.width * m_fImgage_Scale_X;
|
|
|
|
|
alignErr.fbreadth = tplRect.height * m_fImgage_Scale_Y;
|
|
|
|
|
|
|
|
|
|
alignErr.nconfig_qx_type = CONFIG_QX_NAME_cell_other;
|
|
|
|
|
alignErr.qx_name = CONFIG_QX_NAME_Names[CONFIG_QX_NAME_cell_other];
|
|
|
|
|
alignErr.nconfig_qx_type = CONFIG_QX_NAME_other;
|
|
|
|
|
alignErr.qx_name = CONFIG_QX_NAME_Names[CONFIG_QX_NAME_other];
|
|
|
|
|
alignErr.grayDis = diff_align; // 记录内外边缘夹角(度)
|
|
|
|
|
alignErr.detRegionidxList.push_back(0);
|
|
|
|
|
|
|
|
|
|
@ -1516,7 +1516,7 @@ int ImgCheckAnalysisy::AI_QX_Class_Thread()
|
|
|
|
|
ERROR_DOTS_BLOB_DATA *pblob = &blobs.blobTab[submitted];
|
|
|
|
|
if (pblob->ErrType == ERR_TYPE_2)
|
|
|
|
|
{
|
|
|
|
|
pblob->AIclasstype = CONFIG_QX_NAME_cell_YiWu;
|
|
|
|
|
pblob->AIclasstype = CONFIG_QX_NAME_YiWu;
|
|
|
|
|
submitted++;
|
|
|
|
|
completed++;
|
|
|
|
|
continue;
|
|
|
|
|
@ -1828,32 +1828,32 @@ int ImgCheckAnalysisy::DrawResult_Step_1()
|
|
|
|
|
int ImgCheckAnalysisy::AIClassTypeToConfigType(int nAIQXType)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int resultError_type = CONFIG_QX_NAME_cell_other;
|
|
|
|
|
int resultError_type = CONFIG_QX_NAME_other;
|
|
|
|
|
switch (nAIQXType)
|
|
|
|
|
{
|
|
|
|
|
case AI_CLass_QX_NAME_PIN_PoSun:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_PIN_PoSun;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_PIN_PoSun;
|
|
|
|
|
break;
|
|
|
|
|
case AI_CLass_QX_NAME_PIN_QueShi:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_PIN_QueShi;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_PIN_QueShi;
|
|
|
|
|
break;
|
|
|
|
|
case AI_CLass_QX_NAME_BTB_DuanLie:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_BTB_DuanLie;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_BTB_DuanLie;
|
|
|
|
|
break;
|
|
|
|
|
case AI_CLass_QX_NAME_LianXi:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_LianXi;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_LianXi;
|
|
|
|
|
break;
|
|
|
|
|
case AI_CLass_QX_NAME_QueXi:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_QueXi;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_QueXi;
|
|
|
|
|
break;
|
|
|
|
|
case AI_CLass_QX_NAME_YiWu:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_YiWu;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_YiWu;
|
|
|
|
|
break;
|
|
|
|
|
case AI_CLass_QX_NAME_C_BianXing:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_C_BianXing;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_C_BianXing;
|
|
|
|
|
break;
|
|
|
|
|
case AI_CLass_QX_NAME_other:
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_cell_other;
|
|
|
|
|
resultError_type = CONFIG_QX_NAME_other;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
@ -1962,7 +1962,7 @@ int ImgCheckAnalysisy::Pin_Qx_Det(const cv::Mat &img)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 上报缺失/偏移缺陷(缺陷类型可按需调整)
|
|
|
|
|
auto reportPinError = [&](int pinIdx, const cv::Point2f &tplCenter, const std::string &reason)
|
|
|
|
|
auto reportPinError = [&](int pinIdx, const cv::Point2f &tplCenter, const std::string &reason, int nconfig_qx_type)
|
|
|
|
|
{
|
|
|
|
|
QX_ERROR_INFO_ pinErr;
|
|
|
|
|
pinErr.Idx = static_cast<int>(m_pDetResult->pQx_ErrorList->size());
|
|
|
|
|
@ -1974,8 +1974,8 @@ int ImgCheckAnalysisy::Pin_Qx_Det(const cv::Mat &img)
|
|
|
|
|
int shortSide = (r.width < r.height) ? r.width : r.height;
|
|
|
|
|
pinErr.flen = longSide * m_fImgage_Scale_X;
|
|
|
|
|
pinErr.fbreadth = shortSide * m_fImgage_Scale_Y;
|
|
|
|
|
pinErr.nconfig_qx_type = CONFIG_QX_NAME_cell_PIN_QueShi;
|
|
|
|
|
pinErr.qx_name = CONFIG_QX_NAME_Names[CONFIG_QX_NAME_cell_PIN_QueShi];
|
|
|
|
|
pinErr.nconfig_qx_type = nconfig_qx_type;
|
|
|
|
|
pinErr.qx_name = CONFIG_QX_NAME_Names[nconfig_qx_type];
|
|
|
|
|
pinErr.detRegionidxList.push_back(0);
|
|
|
|
|
pinErr.detlog->AddCheckstr(PrintLevel_1, DET_LOG_LEVEL_3, "Pin Check",
|
|
|
|
|
"pin %d center(%d,%d) %s",
|
|
|
|
|
@ -2020,7 +2020,7 @@ int ImgCheckAnalysisy::Pin_Qx_Det(const cv::Mat &img)
|
|
|
|
|
if (bestIdx < 0)
|
|
|
|
|
{
|
|
|
|
|
nMiss++;
|
|
|
|
|
reportPinError(i, tplCenters[i], "miss");
|
|
|
|
|
reportPinError(i, tplCenters[i], "miss", CONFIG_QX_NAME_PIN_QueShi);
|
|
|
|
|
m_pdetlog->AddCheckstr(PrintLevel_0, "Pin Check", "pin %d MISS", i);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
@ -2037,7 +2037,7 @@ int ImgCheckAnalysisy::Pin_Qx_Det(const cv::Mat &img)
|
|
|
|
|
nOffset++;
|
|
|
|
|
char buf[64];
|
|
|
|
|
snprintf(buf, sizeof(buf), "offset dx %.1f dy %.1f", absDx, absDy);
|
|
|
|
|
reportPinError(i, tplCenters[i], buf);
|
|
|
|
|
reportPinError(i, tplCenters[i], buf, CONFIG_QX_NAME_PIN_PianYi);
|
|
|
|
|
m_pdetlog->AddCheckstr(PrintLevel_0, "Pin Check", "pin %d OFFSET dx %.1f dy %.1f", i, absDx, absDy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|