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;