From 740cc346e60b6492341d638337fabf1414675307 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Tue, 14 Jul 2026 15:24:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=89=B9=E9=87=8F=E8=B7=91=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=8B=BC=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/deal.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/example/deal.cpp b/example/deal.cpp index d0c1b32..f2ed195 100644 --- a/example/deal.cpp +++ b/example/deal.cpp @@ -2376,11 +2376,27 @@ int deal::Det_OneProduct_Cell_ET(std::string strProductName, int Idx) int AllImgNum = detImgInfoList.size(); // 遍历所有图片 开始读图处理 - for (int i = 0; i < detImgInfoList.size(); i++) + // 按相机分组,同相机内每两张配对 (BCAA+BCAB 拼接送检,与 preCheck 一致) + std::map> camGroups; + for (int i = 0; i < (int)detImgInfoList.size(); i++) { - std::shared_ptr tem = std::make_shared(); - tem->copy(detImgInfoList.at(i)); - InsertReadImgInfo(tem); + camGroups[detImgInfoList[i].strCamID].push_back(i); + } + AllImgNum = 0; + for (auto& kv : camGroups) + { + auto& indices = kv.second; + for (size_t i = 0; i < indices.size(); i += 2) + { + std::shared_ptr tem = std::make_shared(); + tem->copy(detImgInfoList.at(indices[i])); + if (i + 1 < indices.size()) + { + tem->strPath_B = detImgInfoList.at(indices[i + 1]).strPath; + } + InsertReadImgInfo(tem); + AllImgNum++; + } } m_DetResult.startTime_S = getcurTime(); IN_IMG_Status_ temstatus = IN_IMG_Status_Start;