Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Can I get the original index of point after voxel_down_sample()?

Open ghost opened this issue 6 years ago • 2 comments

Is your feature request related to a problem? Please describe. I want to access the original index of point after down sample, so I can do some specific proccess on it.

Describe the solution you'd like the function voxel_down_sample() can also return points' original index.

Thanks.

ghost avatar Jun 25 '20 01:06 ghost

I'm not sure if I got your question wrong or if that is not feasible. A voxel is kind of a 3D grid, so when you apply voxel_down_sample(), you will average all points (as well as their colors and normals), that are in the corresponding 'cell' of your grid.

If you want to sample down your point cloud by keeping some of your points and discarding others, you should use uniform_down_sample. For this method, the answer to your question is easy, as you will always take the 0th point and then each k-th point (where k is your method parameter).

Or, do you want to know, which points of your original PC were averaged to create each specific point of the downsampled PC? This might be done by voxel_down_sample_and_trace (I've never worked with that method, but it looks promising.) Alternatively, you could run a loop in which you iterate over all points of your downsampled PC and perform a nearest neighbor search, e.g., with KDTree

GnnrMrkr avatar Jun 26 '20 08:06 GnnrMrkr

Thanks a lot ! Your understanding about my question is right and your comment really helped me. Thanks Again.

ghost avatar Jun 26 '20 12:06 ghost