update 优化自适应区域

dev_lsy
liusiyang 1 month ago
parent d64b07472e
commit 4005330c7f

@ -506,8 +506,7 @@ int ImgCheckAnalysisy::Adapt_Config(Mat img, Rect cur_roi, bool b_update){
if(!b_update){ if(!b_update){
return 1; return 1;
} }
int get_edge_roi = GetEdgeRoi(img, cur_roi, 20, 20); if(cur_roi.width <= 0 || cur_roi.height <= 0){
if(get_edge_roi != 0){
return 2; return 2;
} }
m_pdetlog->AddCheckstr(PrintLevel_0, "Adapt_Config", "-------------------start--------------"); m_pdetlog->AddCheckstr(PrintLevel_0, "Adapt_Config", "-------------------start--------------");
@ -633,14 +632,6 @@ int ImgCheckAnalysisy::CheckRun()
m_CheckResult_shareP->basicResult.strChannel = m_CheckResult_shareP->in_shareImage->strChannel; m_CheckResult_shareP->basicResult.strChannel = m_CheckResult_shareP->in_shareImage->strChannel;
m_strCurDetChannel = m_CheckResult_shareP->basicResult.strChannel; m_strCurDetChannel = m_CheckResult_shareP->basicResult.strChannel;
/*自适应更新参数*/
// int64 t000 = cv::getTickCount();
// m_pdetlog->bPrintStr = true;
Adapt_Config(m_CheckResult_shareP->in_shareImage->img, m_CutRoi, m_pbaseCheckFunction->markLine.badapt_region);
// m_pdetlog->bPrintStr = false;
// int64 t111 = cv::getTickCount();
// cout << "-------------------------Adapt_Config------------succ---time ----" << (t111 - t000) * 1000 / cv::getTickFrequency() << "ms" << endl;
// 2、参数检查 // 2、参数检查
int rec = ConfigCheck(DetImgInfo_shareP->img); int rec = ConfigCheck(DetImgInfo_shareP->img);
if (rec != CHECK_OK) if (rec != CHECK_OK)
@ -667,6 +658,9 @@ int ImgCheckAnalysisy::CheckRun()
m_pImageAllResult->pDetResult->CutRoi = m_CutRoi; m_pImageAllResult->pDetResult->CutRoi = m_CutRoi;
m_pImageAllResult->pDetResult->Param_CropRoi = m_Crop_Roi_paramImg; m_pImageAllResult->pDetResult->Param_CropRoi = m_Crop_Roi_paramImg;
/*自适应更新参数 — 基于AI边缘定位的精准ROI*/
Adapt_Config(m_CheckResult_shareP->in_shareImage->img, m_CutRoi, m_pbaseCheckFunction->markLine.badapt_region);
// 生成 检测的图片 // 生成 检测的图片
cv::Mat image; cv::Mat image;
image = m_CheckResult_shareP->in_shareImage->img; image = m_CheckResult_shareP->in_shareImage->img;

Loading…
Cancel
Save