From ee66ae68f44d174760af05fcfa440770bed040c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Corvillo?= Date: Tue, 5 Sep 2017 10:09:03 +0200 Subject: [PATCH] Fixed queryBBIncludes_subsample Extractor's input cloud was not set and sample_points cast to int could reach zero (e.g. if sample_points=0.9) --- outofcore/include/pcl/outofcore/impl/octree_base_node.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp b/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp index 6da81ec249f..661dc49daf4 100644 --- a/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp +++ b/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp @@ -1622,7 +1622,7 @@ namespace pcl if (num_pts > 0) { //always sample at least one point - sample_points = sample_points > 0 ? sample_points : 1; + sample_points = sample_points > 1 ? sample_points : 1; } else { @@ -1639,7 +1639,8 @@ namespace pcl random_sampler.setSample (static_cast (sample_points)); pcl::ExtractIndices extractor; - + extractor.setInputCloud(tmp_blob); + pcl::IndicesPtr downsampled_cloud_indices (new std::vector ()); random_sampler.filter (*downsampled_cloud_indices); extractor.setIndices (downsampled_cloud_indices);