diff --git a/AlgorithmModule/src/ImgCheckAnalysisy.cpp b/AlgorithmModule/src/ImgCheckAnalysisy.cpp index 9f9c88f..62eea98 100644 --- a/AlgorithmModule/src/ImgCheckAnalysisy.cpp +++ b/AlgorithmModule/src/ImgCheckAnalysisy.cpp @@ -2836,6 +2836,8 @@ int ImgCheckAnalysisy::AI_Detect_QX() } } + int nSaveCnt = 0; + int AIInputImg_width = pAI_Model->input_0.width; int AIInputImg_height = pAI_Model->input_0.height; @@ -2966,6 +2968,18 @@ int ImgCheckAnalysisy::AI_Detect_QX() pDetAIResult->blobDetParam->AIMaskImgBLobQueue.push(temAIresult); } } + // AI检测残点图存图:仅保存有残点(mask非零)的结果,最多保存前10个 + if (DetImgInfo_shareP->bDebugsaveImg && cv::countNonZero(AIresult) > 0 && nSaveCnt < 10 && (m_strCurDetChannel == "L0" || m_strCurDetChannel == "Down-Particle")) + { + std::string roi_ext = "[" + std::to_string(result->roi.x) + "," + std::to_string(result->roi.y) + "]"; + std::string strSaveDir = "/home/aidlux/BOE/FOG/AI_Detect/" + DetImgInfo_shareP->strImgProductID + "/"; + CheckUtil::CreateDir(strSaveDir); + std::string strSavePath_in = strSaveDir + m_strCurDetChannel +"_"+ roi_ext + "_"+ "in" + ".png"; + std::string strSavePath_out = strSaveDir + m_strCurDetChannel +"_"+ roi_ext + "_"+ "out" + ".png"; + cv::imwrite(strSavePath_in, result->input); + cv::imwrite(strSavePath_out, AIresult); + nSaveCnt++; + } } completed++; }