diff --git a/AlgorithmModule/src/AI_Edge_Algin.cpp b/AlgorithmModule/src/AI_Edge_Algin.cpp index a55c608..03e71a8 100644 --- a/AlgorithmModule/src/AI_Edge_Algin.cpp +++ b/AlgorithmModule/src/AI_Edge_Algin.cpp @@ -246,7 +246,8 @@ int AI_Edge_Algin::Detect(const cv::Mat &img, DetConfig *pDetConfig, std::shared std::vector vecThreads; 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); }); if (pDetConfig->bDetTag) { diff --git a/AlgorithmModule/src/ImgCheckAnalysisy.cpp b/AlgorithmModule/src/ImgCheckAnalysisy.cpp index f07b55e..87ddcb9 100644 --- a/AlgorithmModule/src/ImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ImgCheckAnalysisy.cpp @@ -15,6 +15,10 @@ #include #include +// 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 @@ -2066,6 +2070,21 @@ int ImgCheckAnalysisy::AI_QX_Class_Thread() 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 pAIDet; // printf("=====>>>>AI_QX_Class_Thread m_strCurDetChannel %s \n", m_strCurDetChannel.c_str()); {