Skip to content

Commit

Permalink
Merge pull request #1366 from dseredyn/master
Browse files Browse the repository at this point in the history
bugfix: in-place filtering with VoxelGrid
  • Loading branch information
jspricke committed Oct 14, 2015
2 parents 2f47533 + f238381 commit c993e57
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tools/mesh_sampling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,16 @@ main (int argc, char **argv)
VoxelGrid<PointXYZ> grid_;
grid_.setInputCloud (cloud_1);
grid_.setLeafSize (leaf_size, leaf_size, leaf_size);
grid_.filter (*cloud_1);

pcl::PointCloud<pcl::PointXYZ>::Ptr res(new pcl::PointCloud<pcl::PointXYZ>);
grid_.filter (*res);

if (VIS)
{
visualization::PCLVisualizer vis3 ("VOXELIZED SAMPLES CLOUD");
vis3.addPointCloud (cloud_1);
vis3.addPointCloud (res);
vis3.spin ();
}

savePCDFileASCII (argv[pcd_file_indices[0]], *cloud_1);
savePCDFileASCII (argv[pcd_file_indices[0]], *res);
}

0 comments on commit c993e57

Please sign in to comment.