feat 添加边缘和主检测存图

dev_heyuan
liusiyang 2 weeks ago
parent 84bd257567
commit a2adff60e8

@ -206,6 +206,17 @@ int AI_Edge_QX_Det::Detect(const cv::Mat &img, cv::Mat &detmask, DetConfig *pDet
continue; continue;
} }
if (bdege || nRuntype != 0)
{
std::string strSaveDir = "/home/aidlux/BOE/FOG/AI_Edge_Detect/";
CheckUtil::CreateDir(strSaveDir);
std::string roi_ext = "[" + std::to_string(r.x) + "," + std::to_string(r.y) + "]";
std::string strSavePath_in = strSaveDir + pDetConfig->strCamChannel + "_" + roi_ext + "_edge_in.png";
std::string strSavePath_out = strSaveDir + pDetConfig->strCamChannel + "_" + roi_ext + "_edge_out.png";
cv::imwrite(strSavePath_in, detimg);
cv::imwrite(strSavePath_out, outMask);
}
// 边缘检测存图
bool isAllZero = true; bool isAllZero = true;
if (cv::countNonZero(outMask) > 0) if (cv::countNonZero(outMask) > 0)
{ {

@ -2835,6 +2835,24 @@ int ImgCheckAnalysisy::AI_Detect_QX()
pDetAIResult->blobDetParam->AIMaskImgBLobQueue.push(temAIresult); pDetAIResult->blobDetParam->AIMaskImgBLobQueue.push(temAIresult);
} }
} }
// AI检测残点图存图
if (DetImgInfo_shareP->bDebugsaveImg)
{
bool bNeedSave = false;
std::string roi_ext = "[" + std::to_string(result->roi.x) + "," + std::to_string(result->roi.y) + "]";
bNeedSave = true;
if (bNeedSave && !AIresult.empty())
{
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);
}
}
} }
completed++; completed++;
} }

Loading…
Cancel
Save