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

Add optional indices arg for fast computation of a small subset of FPFH features #7118

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicolaloi
Copy link
Contributor

@nicolaloi nicolaloi commented Dec 30, 2024

Type

  • Bug fix (non-breaking change which fixes an issue): Fixes #
  • New feature (non-breaking change which adds functionality). Resolves Calculate FPFH only in some points  #7089
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

Allows optional selection of specific points when computing FPFH features for a point cloud. Previously, if you only needed FPFH features from a small subset of points (e.g., ISS keypoints), you had to compute the features for the entire point cloud (which was slow and unnecessary) and then select the relevant features. Now, you can directly compute the FPFH features for just the selected points, resulting in faster performance.

Unrelated, also fixed a bug in #7039 when calling SelectByIndex with invert=true.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

Made significant modifications to multiple files. Extra processing for a correct dataflow was needed when the user provides the required point indices.

An optional argument indices is added to ComputeFPFHFeature and t\ComputeFPFHFeature. If indices is provided, the function computes and returns the FPFH features for only the selected points. Some additional processing is performed to prepare the data. The catch is that even if the user selects n points, to compute the corresponding n FPFH features, the SPFH features of all the neighbors of each selected point must first be computed. And to compute the SPFH feature for a point, you need the data of its neighbors.

This means that selecting 1% or 10% of the points will not result in a 100x or 10x speed-up, because the many SPFH features of all the neighbors still need to be computed. Moreover, the new inner pipelines within the FPFH functions are optimized for selecting a small fraction of indices (around 0-10%). If the fraction of selected indices is large, the speed-up will be minimal. In fact, if the fraction of selected points approaches 100%, calling the function without specifying indices (i.e., computing FPFH features for the entire point cloud) will actually be faster. In the next days I can add benchmark tests too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calculate FPFH only in some points
1 participant