feat 添加L0DP测试存图

dev_lsy
liusiyang 3 months ago
parent d5a2458036
commit c35c61fe38

@ -2836,6 +2836,8 @@ int ImgCheckAnalysisy::AI_Detect_QX()
} }
} }
int nSaveCnt = 0;
int AIInputImg_width = pAI_Model->input_0.width; int AIInputImg_width = pAI_Model->input_0.width;
int AIInputImg_height = pAI_Model->input_0.height; int AIInputImg_height = pAI_Model->input_0.height;
@ -2966,6 +2968,18 @@ int ImgCheckAnalysisy::AI_Detect_QX()
pDetAIResult->blobDetParam->AIMaskImgBLobQueue.push(temAIresult); 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++; completed++;
} }

Loading…
Cancel
Save