|
|
|
|
@ -208,13 +208,22 @@ int AI_Edge_QX_Det::Detect(const cv::Mat &img, cv::Mat &detmask, DetConfig *pDet
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
std::string res_dir = "ok";
|
|
|
|
|
if (cv::countNonZero(outMask) > 0)
|
|
|
|
|
{
|
|
|
|
|
res_dir = "ng";
|
|
|
|
|
}
|
|
|
|
|
if (!detimg.empty() && !outMask.empty())
|
|
|
|
|
{
|
|
|
|
|
std::string strSaveDir = "/home/aidlux/BOE/FOG/AI_Edge_Detect/" + res_dir + "/";
|
|
|
|
|
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;
|
|
|
|
|
|