Search code examples
point-cloudsopen3ddownsampling

Pointcloud downsample


I am using open3d and come across where pointcloud gets downsampled. In below code it downsamples the poincloud with value 0.04.

pointcloud.voxel_down_sample(0.04)

What does this 0.04 value depicts? What is the range we can provide? How the search parameter should look like? Please get me some insights with respect to the value in voxel_down_sample


Solution

  • The values in a pointcloud are usually in some user-defined metric system. This can be feet or meters or any other length metric. For example, if I am using a depth camera which generates depth image in centimeters, and I do not divide depth values by 100 before creating a pointcloud, the values of a vertex say (1.2, 3.4, 5.7) will be in cm.

    When you downsample a pointcloud, the voxel size is in the same unit as your pointcloud. So, if you use pointcloud.voxel_down_sample(0.04) where the vertex of pointcloud are in cm, the downsampling of pointcloud will happen at 0.04 cm.

    Now, downsampling a pointcloud is a two step process. First, create a voxel grid from min_bound to max_bound (think of an axis-aligned cuboid which can hold the pointcloud) and then map each point to the voxel that holds it. Next, average the points belonging to same voxel.

    Check source code of voxel downsample here.