From 0d888587388810385bb29017b6dda178658c387e Mon Sep 17 00:00:00 2001 From: cool609 Date: Tue, 7 Apr 2026 22:56:18 +0800 Subject: [PATCH] =?UTF-8?q?1.0.3=E5=A2=9E=E5=8A=A0=E4=BA=86=E7=82=B9?= =?UTF-8?q?=E5=88=B0=E5=B9=B3=E9=9D=A2=E7=9A=84=E5=8F=82=E6=95=B0=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 ++++- Algo/DetectHole/include/HoleDetectionParams.h | 3 +++ Algo/DetectHole/src/HoleDetection.cpp | 3 ++- Algo/DetectHole/src/PlaneSegmentation.h | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 03001c0..f5e8f95 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ .claude nul build -Algo/DetectHole/Export/ +Algo/DetectHole/Export +Algo/DetectBarIntersection/build +Algo/DetectBarIntersection/data +Algo/DetectBarIntersection/Export \ No newline at end of file diff --git a/Algo/DetectHole/include/HoleDetectionParams.h b/Algo/DetectHole/include/HoleDetectionParams.h index 2ad406a..1e7d536 100644 --- a/Algo/DetectHole/include/HoleDetectionParams.h +++ b/Algo/DetectHole/include/HoleDetectionParams.h @@ -16,6 +16,8 @@ struct RansacPlaneSegmentationParams { float minPlaneRatio; // 平面最小点数占比 (相对最大平面), 建议 0.05-0.2 float maxNormalAngleDeg; // 平面法向量与Z轴最大夹角 (度), 超过则直接丢弃; <=0 表示不过滤 + float maxDistFromPlane; // 点到平面的最大允许距离;超出则从 pointIndices 中移除;<=0 表示不过滤 + RansacPlaneSegmentationParams() : distanceThreshold(0.5f) , maxIterations(500) @@ -24,6 +26,7 @@ struct RansacPlaneSegmentationParams { , growthZThreshold(1.0f) , minPlaneRatio(0.1f) , maxNormalAngleDeg(30.0f) + , maxDistFromPlane(1.f) { } }; diff --git a/Algo/DetectHole/src/HoleDetection.cpp b/Algo/DetectHole/src/HoleDetection.cpp index a067ee3..08464d8 100644 --- a/Algo/DetectHole/src/HoleDetection.cpp +++ b/Algo/DetectHole/src/HoleDetection.cpp @@ -12,7 +12,7 @@ namespace { const static char* g_algo_name = "DetectHole"; - const static char* g_algo_ver = "1.0.2"; + const static char* g_algo_ver = "1.0.3"; void PrintHoleResult(const SHoleResult& hole, int index) { @@ -196,6 +196,7 @@ int DetectMultipleHoles( // ============ Step 2: 法向量过滤 ============ NormalFilterParams normalParams; + normalParams.maxDistFromPlane = ransacParams.maxDistFromPlane; FilterPlanesByNormal(planes, normalParams, points, totalPointCount); // 如果没有找到有效平面,回退到处理整个点云 diff --git a/Algo/DetectHole/src/PlaneSegmentation.h b/Algo/DetectHole/src/PlaneSegmentation.h index b4d4bd2..7725df7 100644 --- a/Algo/DetectHole/src/PlaneSegmentation.h +++ b/Algo/DetectHole/src/PlaneSegmentation.h @@ -298,7 +298,7 @@ struct NormalFilterParams { , refNx(0.0f) , refNy(0.0f) , refNz(1.0f) - , maxDistFromPlane(2.0f) + , maxDistFromPlane(0.0f) {} };