From 7cc8f0db2e424ff092dde70dc4996c02030bb98c Mon Sep 17 00:00:00 2001 From: liusiyang Date: Mon, 1 Jun 2026 16:26:37 +0800 Subject: [PATCH] =?UTF-8?q?log=20=E7=B2=BE=E7=AE=80=E6=97=A5=E5=BF=97?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89printf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../include/CheckErrorCodeDefine.hpp | 6 ++--- AlgorithmModule/include/DetLog.h | 4 +-- AlgorithmModule/include/ImageDetBase.h | 2 +- AlgorithmModule/include/ImageResultJudge.h | 2 +- AlgorithmModule/include/OtherDetect.h | 4 +-- AlgorithmModule/include/QX_Analysis.h | 14 +++++----- AlgorithmModule/src/AIClassify.cpp | 2 +- AlgorithmModule/src/AI_Edge_Algin.cpp | 24 ++++++++--------- AlgorithmModule/src/AI_Edge_QX_Det.cpp | 4 +-- AlgorithmModule/src/AI_Mark_Det.cpp | 2 +- AlgorithmModule/src/AI_Second_Det.cpp | 6 ++--- AlgorithmModule/src/ALLImgCheckAnalysisy.cpp | 21 +++++++-------- AlgorithmModule/src/Blob.c | 2 +- AlgorithmModule/src/CameraCheckAnalysisy.cpp | 14 +++++----- AlgorithmModule/src/CameraResult.cpp | 3 +-- AlgorithmModule/src/Edge_Search.cpp | 24 ++++++++--------- AlgorithmModule/src/ImageAllResult.cpp | 2 +- AlgorithmModule/src/ImageMerge.cpp | 4 +-- AlgorithmModule/src/ImageResultJudge.cpp | 2 -- AlgorithmModule/src/ImageStorage.cpp | 2 +- AlgorithmModule/src/ImgCheckAnalysisy.cpp | 11 ++++---- AlgorithmModule/src/Product.cpp | 3 +-- ConfigModule/include/CheckConfigDefine.h | 26 +++++++++---------- ConfigModule/include/ConfigBase.h | 2 +- 24 files changed, 88 insertions(+), 98 deletions(-) diff --git a/AlgorithmModule/include/CheckErrorCodeDefine.hpp b/AlgorithmModule/include/CheckErrorCodeDefine.hpp index 74d66cc..63cfbec 100644 --- a/AlgorithmModule/include/CheckErrorCodeDefine.hpp +++ b/AlgorithmModule/include/CheckErrorCodeDefine.hpp @@ -105,9 +105,9 @@ struct PRINT_LOG_ break; } - str += stepStr + ": "; - str += str_Format(format, args...); - printf("%s\n", str.c_str()); + // str += stepStr + ": "; + // str += str_Format(format, args...); + // printf("%s\n", str.c_str()); return str; } diff --git a/AlgorithmModule/include/DetLog.h b/AlgorithmModule/include/DetLog.h index daffbb3..3b8f09b 100644 --- a/AlgorithmModule/include/DetLog.h +++ b/AlgorithmModule/include/DetLog.h @@ -96,7 +96,7 @@ struct DetLog str += str_Format_1(format, args...); if (bPrintStr) { - printf("%s\n", str.c_str()); + // printf("%s\n", str.c_str()); } { std::lock_guard lock(mtx); @@ -132,7 +132,7 @@ struct DetLog str += str_Format_1(format, args...); if (bPrintStr) { - printf("%s\n", str.c_str()); + // printf("%s\n", str.c_str()); } if (LogLevel <= addLogLevel) diff --git a/AlgorithmModule/include/ImageDetBase.h b/AlgorithmModule/include/ImageDetBase.h index 182e59f..3ad955f 100644 --- a/AlgorithmModule/include/ImageDetBase.h +++ b/AlgorithmModule/include/ImageDetBase.h @@ -3,7 +3,7 @@ * @Date: 2025-09-11 15:32:52 * @LastEditors: xiewenji 527774126@qq.com * @LastEditTime: 2025-09-14 17:41:14 - * @FilePath: /BOE_CELL_AOI_Detect/AlgorithmModule/include/ImageDetBase.h + * @FilePath: /BOE_FOG_Detect/AlgorithmModule/include/ImageDetBase.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ #ifndef ImageDetBase_H_ diff --git a/AlgorithmModule/include/ImageResultJudge.h b/AlgorithmModule/include/ImageResultJudge.h index eb68767..84c43cf 100644 --- a/AlgorithmModule/include/ImageResultJudge.h +++ b/AlgorithmModule/include/ImageResultJudge.h @@ -75,7 +75,7 @@ private: } } } - printf("find fail ============= \n"); + // printf("find fail ============= \n"); // 实在找不到,就返回原始位置 return newRect; } diff --git a/AlgorithmModule/include/OtherDetect.h b/AlgorithmModule/include/OtherDetect.h index 9b21c8f..6b27f83 100644 --- a/AlgorithmModule/include/OtherDetect.h +++ b/AlgorithmModule/include/OtherDetect.h @@ -52,8 +52,8 @@ public: } void Print() { - printf("bSaveResultImg %s strChannel %s\n", - BOOL_TO_STR(bSaveResultImg), strChannel.c_str()); + // printf("bSaveResultImg %s strChannel %s\n", + // BOOL_TO_STR(bSaveResultImg), strChannel.c_str()); } }; diff --git a/AlgorithmModule/include/QX_Analysis.h b/AlgorithmModule/include/QX_Analysis.h index f2e71de..9287104 100644 --- a/AlgorithmModule/include/QX_Analysis.h +++ b/AlgorithmModule/include/QX_Analysis.h @@ -91,10 +91,10 @@ struct QX_Info } void print(std::string str) { - printf("%s blobIdx %d,result %d area %f energy %f hj %f length %f md %f x %f y %f x %f y %f \n", - str.c_str(), blobIdx, result, area, energy, hj, length, density, plocatin_mm.x, plocatin_mm.y, plocatin_pixel.x, plocatin_pixel.y); - printf("%s blobIdx %d,fmindis %f mindis_locatin_pixel x %d y %d \n", - str.c_str(), blobIdx, fmindis, mindis_locatin_pixel.x, mindis_locatin_pixel.y); + // printf("%s blobIdx %d,result %d area %f energy %f hj %f length %f md %f x %f y %f x %f y %f \n", + // str.c_str(), blobIdx, result, area, energy, hj, length, density, plocatin_mm.x, plocatin_mm.y, plocatin_pixel.x, plocatin_pixel.y); + // printf("%s blobIdx %d,fmindis %f mindis_locatin_pixel x %d y %d \n", + // str.c_str(), blobIdx, fmindis, mindis_locatin_pixel.x, mindis_locatin_pixel.y); } std::string GetInfo() { @@ -248,7 +248,7 @@ struct QXAnalysis_Config } void print(std::string str) { - printf("%s bok %d num %d area %f dis %f len %f hj %d md %f\n", str.c_str(), bok, num, area, dis, len, hj, density); + // printf("%s bok %d num %d area %f dis %f len %f hj %d md %f\n", str.c_str(), bok, num, area, dis, len, hj, density); } }; @@ -303,8 +303,8 @@ struct QX_RESULT } void print(std::string str) { - printf("%s blobIdx %d error_Type %d qx_Num %d min dis %f flen %f x %d y %d \n", - str.c_str(), blobIdx, error_Type, qx_Num, mindis, flen, qx_MisDis_point_pixel.x, qx_MisDis_point_pixel.y); + // printf("%s blobIdx %d error_Type %d qx_Num %d min dis %f flen %f x %d y %d \n", + // str.c_str(), blobIdx, error_Type, qx_Num, mindis, flen, qx_MisDis_point_pixel.x, qx_MisDis_point_pixel.y); } }; struct QX_Analysis_Result_List diff --git a/AlgorithmModule/src/AIClassify.cpp b/AlgorithmModule/src/AIClassify.cpp index f334868..8220fc7 100644 --- a/AlgorithmModule/src/AIClassify.cpp +++ b/AlgorithmModule/src/AIClassify.cpp @@ -168,7 +168,7 @@ int AIClassify::GetDetRoiList(const cv::Mat &src_Img, cv::Rect qx_roi, std::vect // } if (pieceList.size() <= 0) { - printf("Select Roi fail\n"); + // printf("Select Roi fail\n"); return 1; } AI_PIECE_INFO selectPiece; diff --git a/AlgorithmModule/src/AI_Edge_Algin.cpp b/AlgorithmModule/src/AI_Edge_Algin.cpp index 668358e..0553a5a 100644 --- a/AlgorithmModule/src/AI_Edge_Algin.cpp +++ b/AlgorithmModule/src/AI_Edge_Algin.cpp @@ -63,7 +63,7 @@ int AI_Edge_Algin::Detect(const cv::Mat &img, DetConfig *pDetConfig, std::shared re = Det_big(img, rois, pCheckResult_Aling->edge_RoiList, Big_roi, big_mask); if (re != 0) { - printf("AICheck_Edge_Big----error %d \n", re); + // printf("AICheck_Edge_Big----error %d \n", re); if (m_pDetConfig->IsSaveProcessImg()) { cv::imwrite(str_error, img); @@ -84,7 +84,7 @@ int AI_Edge_Algin::Detect(const cv::Mat &img, DetConfig *pDetConfig, std::shared re = Dtet_small(img, rois, Src_Mask); if (re != 0) { - printf("AICheck_Edge_Small----error %d \n", re); + // printf("AICheck_Edge_Small----error %d \n", re); if (m_pDetConfig->IsSaveProcessImg()) { cv::imwrite(str_error, img); @@ -151,7 +151,7 @@ int AI_Edge_Algin::Detect(const cv::Mat &img, DetConfig *pDetConfig, std::shared { double widthDiff = std::abs(result_roi.width - m_pDetConfig->drawRoi.width) * 1.0f / std::min(result_roi.width, m_pDetConfig->drawRoi.width); double heightDiff = std::abs(result_roi.height - m_pDetConfig->drawRoi.height) * 1.0f / std::min(result_roi.height, m_pDetConfig->drawRoi.height); - printf("draw roi %s det %s widthDiff %f heightDiff %f\n", CheckUtil::GetRectString(m_pDetConfig->drawRoi).c_str(), CheckUtil::GetRectString(result_roi).c_str(), widthDiff, heightDiff); + //printf("draw roi %s det %s widthDiff %f heightDiff %f\n", CheckUtil::GetRectString(m_pDetConfig->drawRoi).c_str(), CheckUtil::GetRectString(result_roi).c_str(), widthDiff, heightDiff); // 如果差异超过10%,抛出异常 if (widthDiff > 0.10) { @@ -178,7 +178,7 @@ int AI_Edge_Algin::Detect(const cv::Mat &img, DetConfig *pDetConfig, std::shared { int diff = std::abs(va_big - va_small); // 面积的差异值。 float fs = diff * 1.0f / va_big; - printf("va_big %d va_small %d dff %d diffscale %f \n", va_big, va_small, diff, fs); + // printf("va_big %d va_small %d dff %d diffscale %f \n", va_big, va_small, diff, fs); if (fs > 0.1) { // if (true) @@ -211,7 +211,7 @@ int AI_Edge_Algin::Detect(const cv::Mat &img, DetConfig *pDetConfig, std::shared { int diff = std::abs(va_draw - va_small); // 面积的差异值。 float fs = diff * 1.0f / va_draw; - printf("va_draw %d va_small %d dff %d diffscale %f \n", va_draw, va_small, diff, fs); + // printf("va_draw %d va_small %d dff %d diffscale %f \n", va_draw, va_small, diff, fs); if (fs > 0.1) { return 56; @@ -388,13 +388,13 @@ int AI_Edge_Algin::InitModel_ALL() int re = InitModel_Big(); if (re != 0) { - printf("AI_Edge_Algin InitModel_Big Error \n"); + // printf("AI_Edge_Algin InitModel_Big Error \n"); return re; } re = InitModel_Small(); if (re != 0) { - printf("AI_Edge_Algin InitModel_Small Error \n"); + // printf("AI_Edge_Algin InitModel_Small Error \n"); return re; } @@ -431,7 +431,7 @@ int AI_Edge_Algin::Det_big(const cv::Mat &img, vector &smallRoiList, std:: big_mask = mask; if (re != 0) { - printf("AICheck_Edge_Big----error \n"); + // printf("AICheck_Edge_Big----error \n"); int re123 = 100 + re; return re123; } @@ -481,7 +481,7 @@ int AI_Edge_Algin::Det_big(const cv::Mat &img, vector &smallRoiList, std:: { double widthDiff = std::abs(bigRoi.width - m_pDetConfig->drawRoi.width) * 1.0f / std::min(bigRoi.width, m_pDetConfig->drawRoi.width); double heightDiff = std::abs(bigRoi.height - m_pDetConfig->drawRoi.height) * 1.0f / std::min(bigRoi.height, m_pDetConfig->drawRoi.height); - printf("draw roi %s bigRoi %s widthDiff %f heightDiff %f\n", CheckUtil::GetRectString(m_pDetConfig->drawRoi).c_str(), CheckUtil::GetRectString(bigRoi).c_str(), widthDiff, heightDiff); + // printf("draw roi %s bigRoi %s widthDiff %f heightDiff %f\n", CheckUtil::GetRectString(m_pDetConfig->drawRoi).c_str(), CheckUtil::GetRectString(bigRoi).c_str(), widthDiff, heightDiff); // 如果差异超过10%,抛出异常 if (widthDiff > 0.10) { @@ -753,7 +753,7 @@ int AI_Edge_Algin::Dtet_small(const cv::Mat &img, vector &smallRoiList, cv if (!CheckUtil::RoiInImg(task->roi, img)) { CheckUtil::printROI(task->roi, "small roi 1 "); - printf("img %d %d \n", img.cols, img.rows); + // printf("img %d %d \n", img.cols, img.rows); } task->input = img(smallRoiList.at(submitted)).clone(); @@ -919,8 +919,8 @@ int Image_Feature_Algin::Detect(DetConfig *pDetConfig, Align_Result *pResult, st int m_y = pDetConfig->feature_Roi.y * fy - pDetConfig->Search_Roi.y; pResult->offt_x = bestMatch.x - m_x; pResult->offt_y = bestMatch.y - m_y; - printf("m_x %d bestMatch.x %d offt_x %d\n", m_x, bestMatch.x, pResult->offt_x); - printf("m_y %d bestMatch.y %d offt_y %d\n", m_y, bestMatch.y, pResult->offt_y); + // printf("m_x %d bestMatch.x %d offt_x %d\n", m_x, bestMatch.x, pResult->offt_x); + // printf("m_y %d bestMatch.y %d offt_y %d\n", m_y, bestMatch.y, pResult->offt_y); pResult->bDet = true; diff --git a/AlgorithmModule/src/AI_Edge_QX_Det.cpp b/AlgorithmModule/src/AI_Edge_QX_Det.cpp index b0429cc..02a89f0 100644 --- a/AlgorithmModule/src/AI_Edge_QX_Det.cpp +++ b/AlgorithmModule/src/AI_Edge_QX_Det.cpp @@ -129,11 +129,11 @@ int AI_Edge_QX_Det::Detect(const cv::Mat &img, cv::Mat &detmask, DetConfig *pDet m_pdetlog = pdetlog; if (pDetConfig->ninstruct == 767) { - nRuntype = 1; + // nRuntype = 1; } else if (pDetConfig->ninstruct == 768) { - nRuntype = 2; + // nRuntype = 2; } bool bdege = false; diff --git a/AlgorithmModule/src/AI_Mark_Det.cpp b/AlgorithmModule/src/AI_Mark_Det.cpp index 22f31c3..bd8ea53 100644 --- a/AlgorithmModule/src/AI_Mark_Det.cpp +++ b/AlgorithmModule/src/AI_Mark_Det.cpp @@ -22,7 +22,7 @@ AI_Mark_Det::~AI_Mark_Det() int AI_Mark_Det::Detect(const cv::Mat &img, DetConfigResult *pDetConfig) { m_pdetlog = pDetConfig->pdetlog; - printf("AI_Mark_Det::Detect \n"); + // printf("AI_Mark_Det::Detect \n"); cv::Rect searchroi = pDetConfig->searchroi; if (searchroi.x < 0) diff --git a/AlgorithmModule/src/AI_Second_Det.cpp b/AlgorithmModule/src/AI_Second_Det.cpp index be46ef4..0df4933 100644 --- a/AlgorithmModule/src/AI_Second_Det.cpp +++ b/AlgorithmModule/src/AI_Second_Det.cpp @@ -81,10 +81,10 @@ int AI_SecondDet::Detect(const cv::Mat &img, const cv::Mat &mask, DetConfigResul { if (pDetConfig->pfunction_secondDet->pol_saveProcessImg) { - printf("mask %d %d \n", mask.cols, mask.rows); - printf("AIroi %d %d %d %d\n", AIroi.x, AIroi.y, AIroi.width, AIroi.height); + // printf("mask %d %d \n", mask.cols, mask.rows); + // printf("AIroi %d %d %d %d\n", AIroi.x, AIroi.y, AIroi.width, AIroi.height); detimg123 = mask(AIroi).clone(); - printf("1111mask %d %d \n", mask.cols, mask.rows); + // printf("1111mask %d %d \n", mask.cols, mask.rows); } re12 = Det_Pol(detimg, pDetConfig); diff --git a/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp b/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp index c00aaa4..9319eff 100644 --- a/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ALLImgCheckAnalysisy.cpp @@ -75,7 +75,7 @@ int ReadFlawCodeConfig(std::string json_path) { m_FlawCodeList.erase(m_FlawCodeList.begin(), m_FlawCodeList.end()); std::string strPath = json_path; - printf("ReadFlawCodeConfig path %s\n", strPath.c_str()); + // printf("ReadFlawCodeConfig path %s\n", strPath.c_str()); Json::CharReaderBuilder builder; builder["collectComments"] = true; Json::Value root; @@ -83,12 +83,12 @@ int ReadFlawCodeConfig(std::string json_path) std::ifstream ifs(strPath); if (!ifs.is_open()) { - printf("error:file is open\n"); + // printf("error:file is open\n"); return 0; } if (!Json::parseFromStream(builder, ifs, &root, &err)) { - printf("error:parseFromStream\n"); + // printf("error:parseFromStream\n"); return 0; } @@ -505,7 +505,7 @@ int ALLImgCheckAnalysisy::Det_Product(std::shared_ptr &product) // AnalysiyAll(0); MergeShowImg(product); SetProductResult(product); - printf(">>>>>>>>>>>>>>>Det_Product****************det End************\n"); + // printf(">>>>>>>>>>>>>>>Det_Product****************det End************\n"); return 0; } @@ -629,7 +629,7 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr p) strBase += " Channel:"; strBase += p->strChannel; - printf("strBase %s p->Status %d\n", strBase.c_str(), p->Status); + // printf("strBase %s p->Status %d\n", strBase.c_str(), p->Status); std::shared_ptr product; { std::string strcameraName = p->strParm_WorkCamName; @@ -655,13 +655,13 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr p) // 模式为第一张图,返回异常 if(IN_IMG_Status_Start == p->Status) { - cout << "---ProductID_Exist && IN_IMG_Status_Start == p->Status---" << endl; + // cout << "---ProductID_Exist && IN_IMG_Status_Start == p->Status---" << endl; return CHECK_ERROR_PRODUCT_ID_EXIST; } // 图片都已经完了的状态 if(product->bIsImgComplete) { - cout << "---ProductID_Exist && product->bIsImgComplete is true---" << endl; + // cout << "---ProductID_Exist && product->bIsImgComplete is true---" << endl; ErrorReturn(p); return CHECK_ERROR_PRODUCT_ID_EXIST; @@ -672,7 +672,7 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr p) { strlog += "isnot exist"; //设置其他m_ProductList送图状态设置为结束 - cout << "-------set m_ProductList other product to end-------" << endl ; + // cout << "-------set m_ProductList other product to end-------" << endl ; std::lock_guard lock(mtx_ProductList); for(auto &tem:m_ProductList){ tem->bIsImgComplete = true; @@ -705,7 +705,6 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr p) m_CurProductIdx++; m_ProductList.push_back(product); std::string strTimg = CheckUtil::getCurTimeHMS(); - product->productBaseResult->detlog->bPrintStr = true; product->productBaseResult->detlog->AddCheckstr(PrintLevel_0, "PushInImg", "add new product %s %s ", p->strImgProductID.c_str(), strTimg.c_str()); } else @@ -731,7 +730,6 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr p) if (pCamera.get() == nullptr) { strlog += " | CHECK_ERROR_Camear_ID_Error"; - product->productBaseResult->detlog->bPrintStr = true; product->productBaseResult->detlog->AddCheckstr(PrintLevel_1, "PushInImg end", "%s", strlog.c_str()); ErrorReturn(p); return CHECK_ERROR_Camear_ID_Error; @@ -748,7 +746,6 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr p) product->AddLog(m_strTest); m_strTest = ""; } - product->productBaseResult->detlog->bPrintStr = true; product->productBaseResult->detlog->AddCheckstr(PrintLevel_0, "PushInImg end", "%s", strlog.c_str()); ProductList_cond.notify_all(); } @@ -829,7 +826,7 @@ int ALLImgCheckAnalysisy::MergeShowImg(std::shared_ptr product) void ALLImgCheckAnalysisy::Clear_m_ProductList(){ int num = m_ProductList.size(); string strlog = ""; - printf("******************\n\n m_ProductImgDetResultList %ld \n", m_ProductList.size()); + // printf("******************\n\n m_ProductImgDetResultList %ld \n", m_ProductList.size()); std::lock_guard lock(mtx_ProductList); int idx = -1; for (int i = 0; i < m_ProductList.size(); i++) diff --git a/AlgorithmModule/src/Blob.c b/AlgorithmModule/src/Blob.c index 8b1e625..b854e10 100644 --- a/AlgorithmModule/src/Blob.c +++ b/AlgorithmModule/src/Blob.c @@ -4,7 +4,7 @@ #include "BlobBase.h" void pretest(double x) { - printf("fff %f \n", x); + // printf("fff %f \n", x); } #define max(a, b) (((a) > (b)) ? (a) : (b)) diff --git a/AlgorithmModule/src/CameraCheckAnalysisy.cpp b/AlgorithmModule/src/CameraCheckAnalysisy.cpp index 30c0950..5bd93b8 100644 --- a/AlgorithmModule/src/CameraCheckAnalysisy.cpp +++ b/AlgorithmModule/src/CameraCheckAnalysisy.cpp @@ -96,7 +96,7 @@ int CameraCheckAnalysisy::Detect_Pre() strBasic = ">>" + strSN + " cam:" + m_strcameraName; m_pdetlog->AddCheckstr(PrintLevel_1, "Detect_Pre", "%s ==================start", strBasic.c_str()); - printf( "%s ==================Detect_Pre start\n", strBasic.c_str()); + // printf( "%s ==================Detect_Pre start\n", strBasic.c_str()); std::shared_ptr L255 = m_pCheck_Result->GetL255DetImg(); @@ -280,7 +280,7 @@ int CameraCheckAnalysisy::Detect_Images() long te = CheckUtil::getcurTime(); m_pdetlog->AddCheckstr(PrintLevel_0, "Detect_Images", "Cam %s =====ALL image det complate time %ld ms=============End", strBasic.c_str(), te - ts); // getchar(); - printf("Cam %s =====ALL image det complate time %ld ms=============End \n", strBasic.c_str(), te - ts); + // printf("Cam %s =====ALL image det complate time %ld ms=============End \n", strBasic.c_str(), te - ts); return 0; } @@ -367,8 +367,8 @@ int CameraCheckAnalysisy::ResultParamJudge() // m_pdetlog->AddCheckstr(PrintLevel_1, "ResultParamJudge", " det time %ld ms judge %ld draw %ld", t3 - t1, t2 - t1, t3 - t2); // 把结果转成 json 保存。 用以复测 - std::shared_ptr m_CheckResult_shareP = m_pCheck_Result->ImageALLDetResultList.at(imgidx)->result; - m_CheckResult_shareP->strResultJson = m_CheckResultJson.GetResultString(m_pCheck_Result->ImageALLDetResultList.at(imgidx)->pDetResult); + // std::shared_ptr m_CheckResult_shareP = m_pCheck_Result->ImageALLDetResultList.at(imgidx)->result; + // m_CheckResult_shareP->strResultJson = m_CheckResultJson.GetResultString(m_pCheck_Result->ImageALLDetResultList.at(imgidx)->pDetResult); } long te = CheckUtil::getcurTime(); m_pdetlog->AddCheckstr(PrintLevel_1, "ResultParamJudge", "==================End time %ld ms ", te - ts); @@ -434,7 +434,7 @@ int CameraCheckAnalysisy::ImgEdge(std::shared_ptr L255, ChannelC m_pdetlog->AddCheckstr(PrintLevel_1, "ImgEdge", "==================start %s ", m_strcameraName.c_str()); Function_EdgeROI *pEdgeROI; pEdgeROI = &pFuntion_L255->function.f_EdgeROI; - pEdgeROI->print("pEdgeROI"); + // pEdgeROI->print("pEdgeROI"); Function_Image_Align *pAlign; pAlign = &pFuntion_L255->function.f_Image_Align; @@ -892,10 +892,8 @@ int CameraCheckAnalysisy::CheckImgRun() std::string strCameraName = m_pCheck_Result->cameraBaseResult->strCameraName; int re = 0; Check_Step curcheckStep = m_pCheck_Result->GetCheckStep(); - m_pdetlog->bPrintStr = false; m_pdetlog->AddCheckstr(PrintLevel_1, "CheckImgRun", "Cam %s ------Product_Off_X_mm %f ", m_strcameraName.c_str(), m_AnalysisyConfig.commonCheckConfig.baseConfig.fProduct_Off_X_mm); - m_pdetlog->bPrintStr = true; // 如果是未检测状态,则开始预处理 if (curcheckStep == Check_Step_NODet) { @@ -1235,7 +1233,7 @@ static std::string SanitizePathComponent(const std::string& input) { int CameraCheckAnalysisy::ngImgSave() { // 拷贝智能指针,保证在异步任务中引用计数有效 auto result_copy = m_pCheck_Result; - std::string save_path_root = "/home/aidlux/BOE/CELL_ET/cloud/"; + std::string save_path_root = "/home/aidlux/BOE/FOG/cloud/"; auto task = std::async(std::launch::async, [result_copy, save_path_root]() { try { diff --git a/AlgorithmModule/src/CameraResult.cpp b/AlgorithmModule/src/CameraResult.cpp index 9011e99..daf512a 100644 --- a/AlgorithmModule/src/CameraResult.cpp +++ b/AlgorithmModule/src/CameraResult.cpp @@ -3,7 +3,7 @@ * @Date: 2025-09-13 20:39:37 * @LastEditors: xiewenji 527774126@qq.com * @LastEditTime: 2025-09-24 14:17:12 - * @FilePath: /BOE_CELL_AOI_Detect/AlgorithmModule/src/CameraResult.cpp + * @FilePath: /BOE_FOG_Detect/AlgorithmModule/src/CameraResult.cpp * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ #include "CameraResult.h" @@ -64,7 +64,6 @@ int CameraResult::AddDetImage(std::shared_ptr p) } } std::string strTimg = CheckUtil::getCurTimeHMS(); - detlog->bPrintStr = true; detlog->AddCheckstr(PrintLevel_0, "PushInImg", " product %s Cam %s add new image channel = %s sum img %ld %s", productBaseResult->strproductName.c_str(), cameraBaseResult->strCameraName.c_str(), imgResult->strChannel.c_str(), ImageALLDetResultList.size(), strTimg.c_str()); diff --git a/AlgorithmModule/src/Edge_Search.cpp b/AlgorithmModule/src/Edge_Search.cpp index 70054b2..aaba0ed 100644 --- a/AlgorithmModule/src/Edge_Search.cpp +++ b/AlgorithmModule/src/Edge_Search.cpp @@ -190,7 +190,7 @@ int Edge_Search::Detect_AI(const cv::Mat &detimg, DetConfigResult *pDetConfig, s if (re != 0) { - printf("AIEdgeDete error \n"); + // printf("AIEdgeDete error \n"); return re; } pEdgeDetResult->nresult = 0; @@ -329,7 +329,7 @@ int Edge_Search::Detect_Draw(const cv::Mat &detimg, DetConfigResult *pDetConfig, cv::Mat temimg; cv::threshold(detimg(roi), temimg, threshold_value, max_value, threshold_type); - printf("threshold_value %d\n", threshold_value); + // printf("threshold_value %d\n", threshold_value); // 定义膨胀核 int dilation_size = 3; // 膨胀核的大小 if (pEdgeROI->AI_Erode_Size > 0 && pEdgeROI->AI_Erode_Size < 101) @@ -341,8 +341,8 @@ int Edge_Search::Detect_Draw(const cv::Mat &detimg, DetConfigResult *pDetConfig, // 进行膨胀操作 cv::Mat dilated_image; cv::dilate(temimg, dilated_image, kernel); - printf("detMaskImg= %d %d %d\n", detMaskImg.cols, detMaskImg.rows, detMaskImg.channels()); - printf("dilated_image= %d %d %d\n", dilated_image.cols, dilated_image.rows, dilated_image.channels()); + // printf("detMaskImg= %d %d %d\n", detMaskImg.cols, detMaskImg.rows, detMaskImg.channels()); + // printf("dilated_image= %d %d %d\n", dilated_image.cols, dilated_image.rows, dilated_image.channels()); detMaskImg += dilated_image; } pEdgeDetResult->shieldMask = detMaskImg; @@ -498,7 +498,7 @@ int Edge_Search::SearchEdge(const cv::Mat &detimg, cv::Rect &roi, bool bsave) int re = UDNoiseEdgeDetect(img, 3, 40, 1, detroi, 30, 60); if (re < 0) { - printf("edge error 1 %d \n", re); + // printf("edge error 1 %d \n", re); return re; } roi.y = re + exp; @@ -508,7 +508,7 @@ int Edge_Search::SearchEdge(const cv::Mat &detimg, cv::Rect &roi, bool bsave) cv::Point p1 = cv::Point(0, re); cv::Point p2 = cv::Point(img.cols, re); cv::line(showimg, p1, p2, cv::Scalar(255, 0, 255), 5); - printf(">>>>>1>>000000>\n"); + // printf(">>>>>1>>000000>\n"); } // cv::Point p1 = cv::Point(0, re); // cv::Point p2 = cv::Point(img.cols, re); @@ -678,8 +678,8 @@ int Edge_Search::Feature_Align(const cv::Mat &detimg, DetConfigResult *pDetConfi // cv::imwrite("Align_Kernel_img.png", pFuntion_L255->function.f_Image_Align.feature_Mask); // cv::imwrite("detmaskssss.png", m_DetEdge.detmask); // cv::imwrite("ssss.png", L255->in_shareImage->img); - CheckUtil::printROI(Det_CropRoi, "Det Img Crop Roi"); - CheckUtil::printROI(pAlign->Crop_Roi, "Param Img Crop Roi"); + // CheckUtil::printROI(Det_CropRoi, "Det Img Crop Roi"); + // CheckUtil::printROI(pAlign->Crop_Roi, "Param Img Crop Roi"); Image_Feature_Algin::DetConfig detconfig; detconfig.DetImg = detImg_mask; detconfig.TemplateImg = pAlign->feature_Mask; @@ -771,13 +771,13 @@ int Edge_Search::UDNoiseEdgeDetect(cv::Mat img, int DirectSign, int Gate, int Bo } if (img.channels() != 1) { - printf("*****************************channels\n"); + // printf("*****************************channels\n"); return -12; } if (StepCount < 0 || StepCount >= roi.width) { - printf("*****************************StepCount\n"); + // printf("*****************************StepCount\n"); return -22; } @@ -1023,13 +1023,13 @@ int Edge_Search::LRNoiseEdgeDetect(cv::Mat img, int DirectSign, int Gate, int Bo } if (img.channels() != 1) { - printf("*****************************channels\n"); + // printf("*****************************channels\n"); return -1; } if (StepCount < 0 || StepCount >= roi.width) { - printf("*****************************StepCount\n"); + // printf("*****************************StepCount\n"); return -2; } diff --git a/AlgorithmModule/src/ImageAllResult.cpp b/AlgorithmModule/src/ImageAllResult.cpp index e56b6d6..8640da7 100644 --- a/AlgorithmModule/src/ImageAllResult.cpp +++ b/AlgorithmModule/src/ImageAllResult.cpp @@ -3,7 +3,7 @@ * @Date: 2025-09-13 20:39:37 * @LastEditors: xiewenji 527774126@qq.com * @LastEditTime: 2025-09-24 14:17:55 - * @FilePath: /BOE_CELL_AOI_Detect/AlgorithmModule/src/CameraResult.cpp + * @FilePath: /BOE_FOG_Detect/AlgorithmModule/src/CameraResult.cpp * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ #include "ImageAllResult.h" diff --git a/AlgorithmModule/src/ImageMerge.cpp b/AlgorithmModule/src/ImageMerge.cpp index 7348dbd..04603ba 100644 --- a/AlgorithmModule/src/ImageMerge.cpp +++ b/AlgorithmModule/src/ImageMerge.cpp @@ -185,7 +185,7 @@ int ImageMerge::GetRectAndPoint(const cv::Mat &img, cv::Rect &roi, cv::Point &me int re123 = GetEdgePoint(img, &config, A_line_up); if (re123 != 0) { - printf("DirectSign_UP::111111111111GetEdgePoint111111 A_line_up %d\n", re123); + // printf("DirectSign_UP::111111111111GetEdgePoint111111 A_line_up %d\n", re123); return 1; } @@ -205,7 +205,7 @@ int ImageMerge::GetRectAndPoint(const cv::Mat &img, cv::Rect &roi, cv::Point &me re123 = GetEdgePoint(img, &config, A_line_down); if (re123 != 0) { - printf("DirectSign_UP::111111111111GetEdgePoint111111 A_line_down %d\n", re123); + // printf("DirectSign_UP::111111111111GetEdgePoint111111 A_line_down %d\n", re123); return 1; } diff --git a/AlgorithmModule/src/ImageResultJudge.cpp b/AlgorithmModule/src/ImageResultJudge.cpp index 5cc73ae..60a6302 100644 --- a/AlgorithmModule/src/ImageResultJudge.cpp +++ b/AlgorithmModule/src/ImageResultJudge.cpp @@ -732,10 +732,8 @@ int ImageResultJudge::ResultJudge(std::shared_ptr pImageResult) break; } } - pImageLog->bPrintStr = true; pImageLog->AddCheckstr(PrintLevel_1, DET_LOG_LEVEL_3, "Param Judge", "img %s ====================End ng %d ys %d ok %d nojudge %d ", pImageResult->strChannel.c_str(), pImageResult->NG_num, pImageResult->YS_num, pImageResult->Ok_num, pImageResult->NoJudge_num); - pImageLog->bPrintStr = false; return 0; } diff --git a/AlgorithmModule/src/ImageStorage.cpp b/AlgorithmModule/src/ImageStorage.cpp index da4c699..28131ac 100644 --- a/AlgorithmModule/src/ImageStorage.cpp +++ b/AlgorithmModule/src/ImageStorage.cpp @@ -3,7 +3,7 @@ * @Date: 2025-09-11 15:32:52 * @LastEditors: xiewenji 527774126@qq.com * @LastEditTime: 2025-09-16 09:40:36 - * @FilePath: /BOE_CELL_AOI_Detect/AlgorithmModule/src/ImageStorage.cpp + * @FilePath: /BOE_FOG_Detect/AlgorithmModule/src/ImageStorage.cpp * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ #include "ImageStorage.h" diff --git a/AlgorithmModule/src/ImgCheckAnalysisy.cpp b/AlgorithmModule/src/ImgCheckAnalysisy.cpp index 6390ad9..9d05963 100644 --- a/AlgorithmModule/src/ImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ImgCheckAnalysisy.cpp @@ -52,22 +52,22 @@ int ImgCheckAnalysisy::UpdateConfig(void *pconfig, int nConfigType) re = LoadRunConfig(pconfig); if (re == 0) { - printf("---> LoadRunConfig Succ\n"); + // printf("---> LoadRunConfig Succ\n"); } else { - printf("---> LoadRunConfig Fail\n"); + // printf("---> LoadRunConfig Fail\n"); } break; case CHECK_CONFIG_Module: re = LoadCheckConfig(pconfig); if (re == 0) { - printf("---> LoadAnalysisConfig Succ\n"); + // printf("---> LoadAnalysisConfig Succ\n"); } else { - printf("---> LoadAnalysisConfig Fail\n"); + // printf("---> LoadAnalysisConfig Fail\n"); } break; default: @@ -100,7 +100,7 @@ int ImgCheckAnalysisy::RunStart(void *pconfig1) runner->Start(); m_nErrorCode = CHECK_OK; - printf("ImgCheckAnalysisy >>>> ImgCheckThread %d Start Succ \n", m_nThreadIdx); + // printf("ImgCheckAnalysisy >>>> ImgCheckThread %d Start Succ \n", m_nThreadIdx); return m_nErrorCode; } @@ -423,7 +423,6 @@ int ImgCheckAnalysisy::CheckRun() { m_pdetlog->bPrintStr = true; } - m_pdetlog->bPrintStr = true; m_pdetlog->AddCheckstr(PrintLevel_0, "1、basic Info", "---------------------------1、basic Info---------------------------------"); m_pdetlog->AddCheckstr(PrintLevel_0, "Version", "%s", GetVersion().c_str()); diff --git a/AlgorithmModule/src/Product.cpp b/AlgorithmModule/src/Product.cpp index 3992ece..6fd2c7f 100644 --- a/AlgorithmModule/src/Product.cpp +++ b/AlgorithmModule/src/Product.cpp @@ -3,7 +3,7 @@ * @Date: 2025-09-13 19:26:19 * @LastEditors: xiewenji 527774126@qq.com * @LastEditTime: 2025-09-17 18:10:38 - * @FilePath: /BOE_CELL_AOI_Detect/AlgorithmModule/src/Product.cpp + * @FilePath: /BOE_FOG_Detect/AlgorithmModule/src/Product.cpp * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * */ @@ -34,7 +34,6 @@ std::shared_ptr Product::GetCameraResult(std::string strcameraName return ptr; } } - productBaseResult->detlog->bPrintStr = true; // 不存在,创建新的 CameraResult 并插入 map std::shared_ptr newResult = std::make_shared(); newResult->productBaseResult = productBaseResult; diff --git a/ConfigModule/include/CheckConfigDefine.h b/ConfigModule/include/CheckConfigDefine.h index e1c4c2b..11497a5 100644 --- a/ConfigModule/include/CheckConfigDefine.h +++ b/ConfigModule/include/CheckConfigDefine.h @@ -347,7 +347,7 @@ struct AandEParam } void print(std::string str) { - printf("%s bEnable %d bOk %d area %f area_max %f energy %f hj %f length %f num %d dis %f density %f \n", str.c_str(), bEnable, bOk, area, area_max, energy, hj, length, num, dis, density); + // printf("%s bEnable %d bOk %d area %f area_max %f energy %f hj %f length %f num %d dis %f density %f \n", str.c_str(), bEnable, bOk, area, area_max, energy, hj, length, num, dis, density); } void copy(AandEParam tem) { @@ -706,13 +706,13 @@ struct Function_Base_Det } void print(std::string str) { - printf("%s>>bOpen %d strAIMode %s ", str.c_str(), bOpen, strAIMode.c_str()); + // printf("%s>>bOpen %d strAIMode %s ", str.c_str(), bOpen, strAIMode.c_str()); - for (int i = 0; i < DetQXList.size(); i++) - { - printf("%s ", DetQXList.at(i).c_str()); - } - printf(" \n"); + // for (int i = 0; i < DetQXList.size(); i++) + // { + // printf("%s ", DetQXList.at(i).c_str()); + // } + // printf(" \n"); } std::string GetInfo(std::string str) @@ -751,7 +751,7 @@ struct Function_Use_UP_QX } void print(std::string str) { - printf("%s>>bOpen %d, IOU %f \n", str.c_str(), bOpen, fIOU); + // printf("%s>>bOpen %d, IOU %f \n", str.c_str(), bOpen, fIOU); } std::string GetInfo(std::string str) { @@ -779,7 +779,7 @@ struct Function_OnlyBLob } void print(std::string str) { - printf("%s>>bOpen %d\n", str.c_str(), bOpen); + // printf("%s>>bOpen %d\n", str.c_str(), bOpen); } std::string GetInfo(std::string str) { @@ -810,7 +810,7 @@ struct Function_YXDet } void print(std::string str) { - printf("%s>>bOpen %d strModle %s\n", str.c_str(), bOpen, strModle.c_str()); + // printf("%s>>bOpen %d strModle %s\n", str.c_str(), bOpen, strModle.c_str()); } std::string GetInfo(std::string str) { @@ -849,8 +849,8 @@ struct Function_AI_QX } void print(std::string str) { - printf("%s>>bOpen %d POLToWhitePOL %d AllToChess %d 127WhitePOl_UseDP %d 127WhitePOl_DP_IOU %f\n", - str.c_str(), bOpen, bPOLToWhitePOL, bAllToChess, b127WhitePOl_UseDP, f127WhitePOl_DP_IOU); + // printf("%s>>bOpen %d POLToWhitePOL %d AllToChess %d 127WhitePOl_UseDP %d 127WhitePOl_DP_IOU %f\n", + // str.c_str(), bOpen, bPOLToWhitePOL, bAllToChess, b127WhitePOl_UseDP, f127WhitePOl_DP_IOU); } std::string GetInfo(std::string str) { @@ -891,7 +891,7 @@ struct Function_AI_LD } void print(std::string str) { - printf("%s>>bOpen %d bUseDP %d bWTBLD %d bHSLD %d fDP_IOU %f\n", str.c_str(), bOpen, bUseDP, bWTBLD, bHSLD, fDP_IOU); + // printf("%s>>bOpen %d bUseDP %d bWTBLD %d bHSLD %d fDP_IOU %f\n", str.c_str(), bOpen, bUseDP, bWTBLD, bHSLD, fDP_IOU); } std::string GetInfo(std::string str) { diff --git a/ConfigModule/include/ConfigBase.h b/ConfigModule/include/ConfigBase.h index bfc8215..763cde6 100644 --- a/ConfigModule/include/ConfigBase.h +++ b/ConfigModule/include/ConfigBase.h @@ -3,7 +3,7 @@ * @Date: 2025-09-11 15:32:54 * @LastEditors: xiewenji 527774126@qq.com * @LastEditTime: 2025-09-13 18:49:40 - * @FilePath: /BOE_CELL_AOI_Detect/ConfigModule/include/ConfigBase.h + * @FilePath: /BOE_FOG_Detect/ConfigModule/include/ConfigBase.h * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ #ifndef ConfigBase_H_