pcl
pcl copied to clipboard
The results are different when I use VoxelGrid filter to downsample two same clouds
I have two same clouds, cloud1.ply and cloud2.ply, both have 35947 points. cloud2.ply is obtained from cloud1.ply by only translation, no rotation. When I use VoxelGrid filter with the same parameter in PCL 1.11.1, the resuls are different, one has16274 points, the other has 16224. I check the two clouds, the index and the pose are totally same, the only difference is the coordinate. I don't know why.
@byliut The current implementation of VoxelGrid does not guarantee that the results are exactly the same when the cloud is translated. Is there a reason why you think that or why it should guarantee that? Currently, it is only guaranteed that there will be one point per voxel in the output cloud, but the voxel grid will not "move" when the cloud is translated, so the points may fall into different voxels. If you want to know exactly how the VoxelGrid implementation works, I suggest you take a look at the source code: https://github.com/PointCloudLibrary/pcl/blob/master/filters/include/pcl/filters/impl/voxel_grid.hpp#L216