Open abhishek47kashyap opened 1 week ago
You could swap the point at index 0 with the point of your desired index and then call FarthestPointDownSample. Does this work for you?
swap the point at index 0 with the point of your desired index
That is indeed how I'm doing it right now
Would maintainers be in favor of providing the option to start from a specified index other than 0? I can take a shot at this then and open a PR
Can you explain how you use the feature? I just want to understand the use case better
I've got several camera poses (200+) looking at the same region/scene from different viewpoints. For every camera pose, I want to find n
farthest viewpoints so as to get maximum "spread" for the scene. So my idea is that I can use the camera positions from the poses and run farthest point sampling, cycle through every camera position, and find the set of camera poses that are truly as far apart as they can be.
Admittedly, I'm not directly operating on a point cloud for this use case, but since I'm working with point clouds as part of the project anyway and therefore am already using Open3D, I thought I would create a "point cloud" out of the camera positions and use an Open3D functionality if available. I came across tools like fpsample but I'm not keen on bringing in a new dependency just for this one thing.
Looks like a really good example where setting the start index is needed. Looking forward to the PR!
Checklist
main
branch).My Question
Looking at the implementation of
PointCloud::FarthestPointDownSample()
(linked down below for convenience), the downsampling always starts frompoints_[0]
becausefarthest_index
is initialized as0
. https://github.com/isl-org/Open3D/blob/fcc396e494dd3f1204e53571f37400cac50976ef/cpp/open3d/geometry/PointCloud.cpp#L509-L542However, how could I start the downsampling from another index?
I could copy the implementation and modify the initial value of
farthest_index
to my desired index, but I wanted to ask if something already exists for this.