update 添加开关,关闭AIClass,默认返回TBMark

dev_lsy
liusiyang 3 weeks ago
parent aecff1681d
commit 03d8bdb614

@ -246,7 +246,8 @@ int AI_Edge_Algin::Detect(const cv::Mat &img, DetConfig *pDetConfig, std::shared
std::vector<std::thread> vecThreads; std::vector<std::thread> vecThreads;
re0 = Get_Edge(0, img, pDetConfig, m_pDetConfig->strChannel, Big_roi, Big_outimg, true); re0 = Get_Edge(0, img, pDetConfig, m_pDetConfig->strChannel, Big_roi, Big_outimg, true);
cv::Mat Big_outimg_src = img(Big_roi[0].boundingRect()); cv::Rect Big_roi_rect = Big_roi[0].boundingRect() & cv::Rect(0, 0, img.cols, img.rows);
cv::Mat Big_outimg_src = img(Big_roi_rect).clone();
vecThreads.emplace_back([&]() { re1 = Get_Edge(1, Big_outimg_src, pDetConfig, m_pDetConfig->strChannel, Small_roi, Small_outimg, false); }); vecThreads.emplace_back([&]() { re1 = Get_Edge(1, Big_outimg_src, pDetConfig, m_pDetConfig->strChannel, Small_roi, Small_outimg, false); });
if (pDetConfig->bDetTag) if (pDetConfig->bDetTag)
{ {

@ -15,6 +15,10 @@
#include <algorithm> #include <algorithm>
#include <cctype> #include <cctype>
// AI缺陷分类模型开关:当前暂无分类模型(Class.engine),分类流程代码先预留;
// 待分类模型部署后,将 AI_CLASS_MODEL_ENABLE 置 1,即可恢复 AI_QX_Class_Thread 中的AI分类流程
#define AI_CLASS_MODEL_ENABLE 0
// 把手判定参数: // 把手判定参数:
// 每个非空的"把手区域"附近都应该有一个把手:凸起宽高与该区域外接矩形宽高的比值落在下面范围内才算匹配 // 每个非空的"把手区域"附近都应该有一个把手:凸起宽高与该区域外接矩形宽高的比值落在下面范围内才算匹配
#define HANDLE_SIZE_MIN_RATIO 0.8f #define HANDLE_SIZE_MIN_RATIO 0.8f
@ -2066,6 +2070,21 @@ int ImgCheckAnalysisy::AI_QX_Class_Thread()
m_pdetlog->AddCheckstr(PrintLevel_1, DET_LOG_LEVEL_3, "QX_Class", " Start"); m_pdetlog->AddCheckstr(PrintLevel_1, DET_LOG_LEVEL_3, "QX_Class", " Start");
#if !AI_CLASS_MODEL_ENABLE
// 当前暂无AI分类模型(Class.engine):所有缺陷先统一按 铜箔标记(TBMark) 类型返回;
// 原AI分类流程代码先预留(见下方),待分类模型部署后置 AI_CLASS_MODEL_ENABLE 为 1 即可恢复
{
int defaultqx = AIClassTypeToConfigType(AI_CLass_QX_NAME_TBMark);
for (int i = 0; i < blobs.blobCount; i++)
{
blobs.blobTab[i].AIclasstype = defaultqx;
}
m_pdetlog->AddCheckstr(PrintLevel_1, DET_LOG_LEVEL_3, "QX_Class", " no class model, all %d qx -> TBMark(%d)", blobs.blobCount, defaultqx);
}
return 0;
#endif // !AI_CLASS_MODEL_ENABLE
// ==================== 以下为AI分类模型流程(模型未部署期间代码预留,勿删) ====================
std::shared_ptr<AIModel_Base> pAIDet; std::shared_ptr<AIModel_Base> pAIDet;
// printf("=====>>>>AI_QX_Class_Thread m_strCurDetChannel %s \n", m_strCurDetChannel.c_str()); // printf("=====>>>>AI_QX_Class_Thread m_strCurDetChannel %s \n", m_strCurDetChannel.c_str());
{ {

Loading…
Cancel
Save