From 16fb40399a2f351a1f795a16809bce7b8db9c901 Mon Sep 17 00:00:00 2001 From: jerryzeng Date: Sun, 24 May 2026 14:05:19 +0800 Subject: [PATCH] =?UTF-8?q?rodAndBarDetection=20version=201.3.1=20:=20?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E7=9B=98=E4=B8=AD=E5=BF=83=E6=B5=8B=E9=87=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=99=AA=E5=A3=B0?= =?UTF-8?q?=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rodAndBarDetection_test.cpp | 4 ++-- sourceCode/rodAndBarDetection.cpp | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/rodAndBarDetection_test/rodAndBarDetection_test.cpp b/rodAndBarDetection_test/rodAndBarDetection_test.cpp index 9b13112..84ade3b 100644 --- a/rodAndBarDetection_test/rodAndBarDetection_test.cpp +++ b/rodAndBarDetection_test/rodAndBarDetection_test.cpp @@ -1085,7 +1085,7 @@ void newLocatingPlateTest(void) }; SVzNLRange fileIdx[NEW_LOCATING_PALTE_TEST_GROUP] = { - {2,11}, + {12,13}, }; const char* ver = wd_rodAndBarDetectionVersion(); @@ -1137,7 +1137,7 @@ void newLocatingPlateTest(void) void rodPositionTest(void) { const char* dataPath[ROD_POSITION_TEST_GROUP] = { - "F:/ShangGu/项目/冠钦项目/矩森棒材抓取/", //0 + "F:/ShangGu/项目/冠钦项目/矩森棒材抓取/测试数据/", //0 "F:/ShangGu/项目/冠钦项目/胶布圆棒抓取/模拟测试数据/", //1 "F:/ShangGu/项目/冠钦项目/胶布圆棒抓取/模拟测试数据2/", //1 }; diff --git a/sourceCode/rodAndBarDetection.cpp b/sourceCode/rodAndBarDetection.cpp index 8b353f9..56fe5d0 100644 --- a/sourceCode/rodAndBarDetection.cpp +++ b/sourceCode/rodAndBarDetection.cpp @@ -21,7 +21,8 @@ //version 1.2.10 : Ľݸ˶λȡ㷨 //version 1.2.11 : ֳݵ //version 1.3.0 : µĶλIJ -std::string m_strVersion = "1.3.0"; +//version 1.3.1 : λIJ +std::string m_strVersion = "1.3. "; const char* wd_rodAndBarDetectionVersion(void) { return m_strVersion.c_str(); @@ -2039,7 +2040,7 @@ SSX_platePoseInfo sx_getLocationPlatePose_new( { int idx_0 = line_verticalSegs[i].start; for (int j = 0; j < line_verticalSegs[i].len; j++) - flags[idx_0+j][line] = 1; + flags[idx_0 + j][line] = 1; } } //ע @@ -2085,6 +2086,8 @@ SSX_platePoseInfo sx_getLocationPlatePose_new( ); //ǰĿ + const double topPlateMinW = 150; + const double topPlateMinH = 150; std::vector objMeanZ; objMeanZ.resize(objClusters.size()); for (int i = 0; i < (int)objClusters.size(); i++) @@ -2092,10 +2095,16 @@ SSX_platePoseInfo sx_getLocationPlatePose_new( SSG_ROIRectD a_roi = _getListROI(objClusters[i]); double w = a_roi.right - a_roi.left; double h = a_roi.bottom - a_roi.top; + if ((w > topPlateMinW) && (h > topPlateMinH)) + { - double meanZ = _getListMeanZ(objClusters[i]); - objMeanZ[i] = meanZ; + double meanZ = _getListMeanZ(objClusters[i]); + objMeanZ[i] = meanZ; + } + else + objMeanZ[i] = 0; 0; } + //ѡzСĿΪ int objIdx = -1; double minMeanZ = DBL_MAX;