Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguities associated to the KdTree Sampling construction scheme #114

Closed
nmellado opened this issue Oct 6, 2023 · 0 comments · Fixed by #129
Closed

Ambiguities associated to the KdTree Sampling construction scheme #114

nmellado opened this issue Oct 6, 2023 · 0 comments · Fixed by #129
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@nmellado
Copy link
Contributor

nmellado commented Oct 6, 2023

The KdTree class offers construction methods on a subset of the input point clouds.
This is called sampling: the caller provides a raw buffer of point and a vector of indices. The tree is built by iterating over the indices list.

As for non-sampling cases, the indices used to construct the IndexQueries (meaning I want the closest points of the I-th vertex) and their results (the closest points are at indices ....) are indices in the raw buffer frame: the query caller doesn't need to know if the KdTree is built with sampling or not.

There are several issues with this design:

  • The IndexQueries semantics is ambiguous when using subsampling: some users might expect to use indices expressed in the sampling vector frame. The implemented behavior is not described in the documentation.
  • Also, it is bit weird to be able to use an InputIndex of a point that is not in the KdTree (and thus, somehow, does not have an index).
  • The KnnGraph queries are ambiguous when using KdTree sampling: users can in theory call the graph only from the sampled points. If we respect the IndexQuery formalism, the caller uses the Index in the raw buffer frame: this index needs to be checked, and the query construction aborted if the point is not in the sampling set.

Positive aspects of this design:

  • The input point coordinates are never duplicated, and several KdTrees can be built on multiple subsets of points.

Question

Considering the aforementioned aspects, do you have any comment or suggestion to fix/modify/extend the API ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant