What is the function of the grid points? Can it be used to subsample a point cloud in a voxel downsample way?
liuzhy71 opened this issue · comments
Hi,
Thank you for the great work!
Currently I need to find the k nearest neighbor for a point cloud, then I need to downsample the point cloud in a voxel downsample way, can the grid output be use for the downsampling?
Hi,
I hope I understand your question correctly. Here is the documentation for the returned grid structure:
Lines 217 to 223 in 59a4c8f
In sorted_points2
, points are sorted according to their voxel index. Therefore, with pc2_grid_off
you will know the points inside one specific voxel (Here 2 are hard-coded for 2D points, you might want to change to 3):
FRNN/frnn/csrc/grid/find_nbrs.cu
Lines 50 to 60 in 3e370d8
And then you can do whatever you want to downsample the points inside each voxel.
Thanks a lot! Are we allowed to change the initial grid size before fitting the knn?
Yes, the search radius r
and radius_cell_ratio
jointly determine the grid size:
Line 77 in 3e370d8
For KNN you should find a radius large enough so that you can find K neighbors within the radius for sure. When the radius_cell_ratio
is an integer, the method runs more efficiently since it search 2*ceil(radius_cell_ratio)+1
grids on one dimension.