update 优化缺陷列表

dev_lsy
liusiyang 1 week ago
parent 455884c373
commit b1b6a29402

@ -1044,28 +1044,28 @@ int ImageResultJudge::ConfigTypeToResultType(int nconfigType)
{ {
switch (nconfigType) switch (nconfigType)
{ {
case CONFIG_QX_NAME_cell_PIN_PoSun: case CONFIG_QX_NAME_PIN_PoSun:
resultError_type = ERROR_TYPE_PIN_PoSun; resultError_type = ERROR_TYPE_PIN_PoSun;
break; break;
case CONFIG_QX_NAME_cell_PIN_QueShi: case CONFIG_QX_NAME_PIN_QueShi:
resultError_type = ERROR_TYPE_PIN_QueShi; resultError_type = ERROR_TYPE_PIN_QueShi;
break; break;
case CONFIG_QX_NAME_cell_BTB_DuanLie: case CONFIG_QX_NAME_BTB_DuanLie:
resultError_type = ERROR_TYPE_BTB_DuanLie; resultError_type = ERROR_TYPE_BTB_DuanLie;
break; break;
case CONFIG_QX_NAME_cell_LianXi: case CONFIG_QX_NAME_LianXi:
resultError_type = ERROR_TYPE_LianXi; resultError_type = ERROR_TYPE_LianXi;
break; break;
case CONFIG_QX_NAME_cell_QueXi: case CONFIG_QX_NAME_QueXi:
resultError_type = ERROR_TYPE_QueXi; resultError_type = ERROR_TYPE_QueXi;
break; break;
case CONFIG_QX_NAME_cell_YiWu: case CONFIG_QX_NAME_YiWu:
resultError_type = ERROR_TYPE_YiWu; resultError_type = ERROR_TYPE_YiWu;
break; break;
case CONFIG_QX_NAME_cell_C_BianXing: case CONFIG_QX_NAME_C_BianXing:
resultError_type = ERROR_TYPE_C_BianXing; resultError_type = ERROR_TYPE_C_BianXing;
break; break;
case CONFIG_QX_NAME_cell_other: case CONFIG_QX_NAME_other:
resultError_type = ERROR_TYPE_other; resultError_type = ERROR_TYPE_other;
break; break;

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

@ -39,14 +39,15 @@ static const std::string WHITE_BLCAK_Names[] =
// 检测缺陷的种类 // 检测缺陷的种类
enum CONFIG_QX_NAME_ enum CONFIG_QX_NAME_
{ {
CONFIG_QX_NAME_cell_PIN_PoSun, // 分类 PIN破损 CONFIG_QX_NAME_PIN_PoSun, // 分类 PIN破损
CONFIG_QX_NAME_cell_PIN_QueShi, // 分类 PIN缺失 CONFIG_QX_NAME_PIN_QueShi, // 分类 PIN缺失
CONFIG_QX_NAME_cell_BTB_DuanLie, // 分类 BTB断裂 CONFIG_QX_NAME_BTB_DuanLie, // 分类 BTB断裂
CONFIG_QX_NAME_cell_LianXi, // 分类 连锡 CONFIG_QX_NAME_LianXi, // 分类 连锡
CONFIG_QX_NAME_cell_QueXi, // 分类 缺锡 CONFIG_QX_NAME_QueXi, // 分类 缺锡
CONFIG_QX_NAME_cell_YiWu, // 分类 异物 CONFIG_QX_NAME_YiWu, // 分类 异物
CONFIG_QX_NAME_cell_C_BianXing, // 分类 C型卡口异常 CONFIG_QX_NAME_C_BianXing, // 分类 C型卡口异常
CONFIG_QX_NAME_cell_other, // 分类 其他 CONFIG_QX_NAME_other, // 分类 其他
CONFIG_QX_NAME_PIN_PianYi, // 分类 PIN偏移
CONFIG_QX_NAME_count, CONFIG_QX_NAME_count,
}; };
// 缺陷项对应在参数中的名称 // 缺陷项对应在参数中的名称
@ -60,6 +61,7 @@ static std::vector<std::string> CONFIG_QX_NAME_Names =
"YiWu", "YiWu",
"C_BianXing", "C_BianXing",
"other", "other",
"PIN_PianYi",
}; };
// 分析类型 // 分析类型

@ -807,11 +807,11 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value)
if (value_f["form"]["Det_Config"]["pin_x_offset"]) if (value_f["form"]["Det_Config"]["pin_x_offset"])
{ {
_config.pinDet.pin_x_offset = value_f["form"]["Search_Config"]["pin_x_offset"].asFloat(); _config.pinDet.pin_x_offset = value_f["form"]["Det_Config"]["pin_x_offset"].asFloat();
} }
if (value_f["form"]["Det_Config"]["pin_y_offset"]) if (value_f["form"]["Det_Config"]["pin_y_offset"])
{ {
_config.pinDet.pin_y_offset = value_f["form"]["Detect_Config"]["pin_y_offset"].asFloat(); _config.pinDet.pin_y_offset = value_f["form"]["Det_Config"]["pin_y_offset"].asFloat();
} }
if (value_f["form"]["otherConfig"]["bDrawResult"]) if (value_f["form"]["otherConfig"]["bDrawResult"])
{ {
@ -864,83 +864,83 @@ int BaseFuntonConfigJson::GetFunction(Json::Value value)
{ {
if (value_f["form"]["PIN_PoSun"]["open"]) if (value_f["form"]["PIN_PoSun"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_PIN_PoSun].bOpen = value_f["form"]["PIN_PoSun"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_PIN_PoSun].bOpen = value_f["form"]["PIN_PoSun"]["open"].asBool();
} }
if (value_f["form"]["PIN_PoSun"]["Area"]) if (value_f["form"]["PIN_PoSun"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_PIN_PoSun].fArea = value_f["form"]["PIN_PoSun"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_PIN_PoSun].fArea = value_f["form"]["PIN_PoSun"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_PIN_PoSun].strname = "PIN_PoSun"; _config.bigNG.qx[CONFIG_QX_NAME_PIN_PoSun].strname = "PIN_PoSun";
if (value_f["form"]["PIN_QueShi"]["open"]) if (value_f["form"]["PIN_QueShi"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_PIN_QueShi].bOpen = value_f["form"]["PIN_QueShi"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_PIN_QueShi].bOpen = value_f["form"]["PIN_QueShi"]["open"].asBool();
} }
if (value_f["form"]["PIN_QueShi"]["Area"]) if (value_f["form"]["PIN_QueShi"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_PIN_QueShi].fArea = value_f["form"]["PIN_QueShi"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_PIN_QueShi].fArea = value_f["form"]["PIN_QueShi"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_PIN_QueShi].strname = "PIN_QueShi"; _config.bigNG.qx[CONFIG_QX_NAME_PIN_QueShi].strname = "PIN_QueShi";
if (value_f["form"]["BTB_DuanLie"]["open"]) if (value_f["form"]["BTB_DuanLie"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_BTB_DuanLie].bOpen = value_f["form"]["BTB_DuanLie"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_BTB_DuanLie].bOpen = value_f["form"]["BTB_DuanLie"]["open"].asBool();
} }
if (value_f["form"]["BTB_DuanLie"]["Area"]) if (value_f["form"]["BTB_DuanLie"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_BTB_DuanLie].fArea = value_f["form"]["BTB_DuanLie"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_BTB_DuanLie].fArea = value_f["form"]["BTB_DuanLie"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_BTB_DuanLie].strname = "BTB_DuanLie"; _config.bigNG.qx[CONFIG_QX_NAME_BTB_DuanLie].strname = "BTB_DuanLie";
if (value_f["form"]["LianXi"]["open"]) if (value_f["form"]["LianXi"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_LianXi].bOpen = value_f["form"]["LianXi"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_LianXi].bOpen = value_f["form"]["LianXi"]["open"].asBool();
} }
if (value_f["form"]["LianXi"]["Area"]) if (value_f["form"]["LianXi"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_LianXi].fArea = value_f["form"]["LianXi"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_LianXi].fArea = value_f["form"]["LianXi"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_LianXi].strname = "LianXi"; _config.bigNG.qx[CONFIG_QX_NAME_LianXi].strname = "LianXi";
if (value_f["form"]["QueXi"]["open"]) if (value_f["form"]["QueXi"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_QueXi].bOpen = value_f["form"]["QueXi"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_QueXi].bOpen = value_f["form"]["QueXi"]["open"].asBool();
} }
if (value_f["form"]["QueXi"]["Area"]) if (value_f["form"]["QueXi"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_QueXi].fArea = value_f["form"]["QueXi"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_QueXi].fArea = value_f["form"]["QueXi"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_QueXi].strname = "QueXi"; _config.bigNG.qx[CONFIG_QX_NAME_QueXi].strname = "QueXi";
if (value_f["form"]["YiWu"]["open"]) if (value_f["form"]["YiWu"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_YiWu].bOpen = value_f["form"]["YiWu"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_YiWu].bOpen = value_f["form"]["YiWu"]["open"].asBool();
} }
if (value_f["form"]["YiWu"]["Area"]) if (value_f["form"]["YiWu"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_YiWu].fArea = value_f["form"]["YiWu"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_YiWu].fArea = value_f["form"]["YiWu"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_YiWu].strname = "YiWu"; _config.bigNG.qx[CONFIG_QX_NAME_YiWu].strname = "YiWu";
if (value_f["form"]["C_BianXing"]["open"]) if (value_f["form"]["C_BianXing"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_C_BianXing].bOpen = value_f["form"]["C_BianXing"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_C_BianXing].bOpen = value_f["form"]["C_BianXing"]["open"].asBool();
} }
if (value_f["form"]["C_BianXing"]["Area"]) if (value_f["form"]["C_BianXing"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_C_BianXing].fArea = value_f["form"]["C_BianXing"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_C_BianXing].fArea = value_f["form"]["C_BianXing"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_C_BianXing].strname = "C_BianXing"; _config.bigNG.qx[CONFIG_QX_NAME_C_BianXing].strname = "C_BianXing";
if (value_f["form"]["other"]["open"]) if (value_f["form"]["other"]["open"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_other].bOpen = value_f["form"]["other"]["open"].asBool(); _config.bigNG.qx[CONFIG_QX_NAME_other].bOpen = value_f["form"]["other"]["open"].asBool();
} }
if (value_f["form"]["other"]["Area"]) if (value_f["form"]["other"]["Area"])
{ {
_config.bigNG.qx[CONFIG_QX_NAME_cell_other].fArea = value_f["form"]["other"]["Area"].asFloat(); _config.bigNG.qx[CONFIG_QX_NAME_other].fArea = value_f["form"]["other"]["Area"].asFloat();
} }
_config.bigNG.qx[CONFIG_QX_NAME_cell_other].strname = "other"; _config.bigNG.qx[CONFIG_QX_NAME_other].strname = "other";
} }
else else
{ {

Loading…
Cancel
Save