From d79f11b931ecd4480d02ef4e923c2342851914f8 Mon Sep 17 00:00:00 2001 From: Benjamin Grzimek Date: Wed, 30 Aug 2017 17:04:07 +0200 Subject: [PATCH 1/2] fix 'region_growing_segmenter' 'region_growing_estimator_' crashes at 'extract()' if empty indices are set. --- segmatch/src/segmenters/region_growing_segmenter.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/segmatch/src/segmenters/region_growing_segmenter.cpp b/segmatch/src/segmenters/region_growing_segmenter.cpp index 165c8d2..92e1c0f 100644 --- a/segmatch/src/segmenters/region_growing_segmenter.cpp +++ b/segmatch/src/segmenters/region_growing_segmenter.cpp @@ -64,6 +64,10 @@ void RegionGrowingSegmenter::segment(const PointICloud& cloud, indices->push_back(i); } } + if (indices->size() == 0) { + LOG(INFO) << "No points with curvature < " << params_.rg_curvature_threshold << "."; + return; + } LOG(INFO) << "Number of indices " << indices->size(); LOG(INFO) << "Number of normals " << normals->size(); From ed23b14a9c9098a0fb8656f3ef5b3f5bc57a97c9 Mon Sep 17 00:00:00 2001 From: Benjamin Grzimek Date: Tue, 5 Sep 2017 11:00:51 +0200 Subject: [PATCH 2/2] Ads 'u' for unsigned integer --- segmatch/src/segmenters/region_growing_segmenter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/segmatch/src/segmenters/region_growing_segmenter.cpp b/segmatch/src/segmenters/region_growing_segmenter.cpp index 92e1c0f..a22194e 100644 --- a/segmatch/src/segmenters/region_growing_segmenter.cpp +++ b/segmatch/src/segmenters/region_growing_segmenter.cpp @@ -64,7 +64,7 @@ void RegionGrowingSegmenter::segment(const PointICloud& cloud, indices->push_back(i); } } - if (indices->size() == 0) { + if (indices->size() == 0u) { LOG(INFO) << "No points with curvature < " << params_.rg_curvature_threshold << "."; return; }