PointCloudLibrary / PointCloudLibrary/pcl

Remove warning from VoxelGrid

Open
#585 13 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind: question module: filters needs: feedback
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

When I use VoxelGrid with a small grid size on a large point cloud, it sometimes gives the warning message " [pcl::VoxelGrid::applyFilter] Leaf size is too small for the input dataset. Integer indices would overflow".
VoxelGrid then returns the original point cloud.

IMO, this is nonsense. The number of points in the downsampled point cloud cannot be larger than in the original point cloud, just by definition of the voxel grid filter. And the implementation of voxel grid is such that indices never exceed the number of points in the original point cloud. Empty voxels are ignored.

My suggestion is to remove this warning. I commented out the warning in my application, and it runs just fine. The change would affect the files voxel_grid.hpp, voxel_grid.cpp, voxel_grid_label.cpp.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the warning path and its call sites in voxel_grid.hpp, voxel_grid.cpp, and voxel_grid_label.cpp. Reproduce the small-grid, large-point-cloud case, then verify that removing the warning does not change VoxelGrid's returned point cloud behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.