Skip to content

Move further towards KdTreeNanoflann#6417

Merged
mvieth merged 2 commits intoPointCloudLibrary:masterfrom
mvieth:nanoflann_default5
Apr 9, 2026
Merged

Move further towards KdTreeNanoflann#6417
mvieth merged 2 commits intoPointCloudLibrary:masterfrom
mvieth:nanoflann_default5

Conversation

@mvieth
Copy link
Copy Markdown
Member

@mvieth mvieth commented Mar 29, 2026

Failed build on macOS seems unrelated to the changes here. I will take a look and open another pull request to fix those.

Changes:

  • do not manually set a kdtree as the search method for SIFTKeypoint, NormalEstimation, EuclideanClusterExtraction, etc. Instead, let them choose the search method automatically
  • use autoSelectMethod in more places
  • in GICP6D, use KdTreeNanoflann if availble, else KdTree. For KdTreeNanoflann, use 6 search dimensions to work correctly with MyPointRepresentation (X, Y, Z, L, A, B). For KdTree, the search dimensions are always determined dynamically at run-time but this makes it a bit slower
  • there is no reason why test_narf has to link to FLANN::FLANN explicitly

@mvieth mvieth added the changelog: enhancement Meta-information for changelog generation label Mar 29, 2026
@mvieth mvieth force-pushed the nanoflann_default5 branch 4 times, most recently from 382e785 to b1441b8 Compare April 2, 2026 19:42
@mvieth mvieth marked this pull request as ready for review April 3, 2026 08:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR continues the migration away from explicit FLANN/KdTreeFLANN usage by letting algorithms auto-select the optimal spatial search backend, and by preferentially using KdTreeNanoflann in GICP6D when available.

Changes:

  • Remove manual KdTree/search-method wiring in multiple algorithms/examples and rely on internal/default search selection.
  • Expand usage of pcl::search::autoSelectMethod and introduce a nanoflann-backed 6D tree for GICP6D.
  • Simplify test linkage by removing an explicit FLANN::FLANN dependency from test_narf.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tools/cluster_extraction.cpp Stop manually providing a KdTree to Euclidean cluster extraction.
test/keypoints/test_keypoints.cpp Add missing include for kdtree usage in keypoint tests.
test/features/CMakeLists.txt Remove explicit FLANN::FLANN link from test_narf.
surface/include/pcl/surface/impl/texture_mapping.hpp Replace KdTreeFLANN<PointXY> with autoSelectMethod-selected search object.
segmentation/include/pcl/segmentation/impl/region_growing_rgb.hpp Use autoSelectMethod for search initialization when unset.
segmentation/include/pcl/segmentation/impl/cpc_segmentation.hpp Remove manual kdtree wiring for Euclidean clustering.
registration/src/gicp6d.cpp Prefer KdTreeNanoflann (6D) when available; fallback to KdTree (FLANN).
registration/include/pcl/registration/gicp6d.h Store target search structure as a pcl::search::KdTree pointer.
registration/include/pcl/registration/transformation_validation_euclidean.h Remove legacy kdtree include; rely on search kdtree.
registration/include/pcl/registration/correspondence_estimation_backprojection.h Remove unused KdTree type aliases.
registration/include/pcl/registration/bfgs.h Add missing <cassert> include.
recognition/include/pcl/recognition/implicit_shape_model.h Replace KdTreeFLANN member with pcl::search::Search pointer.
recognition/include/pcl/recognition/impl/implicit_shape_model.hpp Build vote search tree via autoSelectMethod.
recognition/include/pcl/recognition/impl/hv/hv_go.hpp Remove manual kdtree setup for normal estimation.
keypoints/include/pcl/keypoints/impl/sift_keypoint.hpp Build octave search structure via autoSelectMethod.
gpu/people/tools/people_tracking.cpp Remove unused kdtree include.
gpu/examples/segmentation/src/seg.cpp Remove legacy kdtree include (relies on other headers).
features/include/pcl/features/impl/our_cvfh.hpp Use autoSelectMethod for radius-search tree.
features/include/pcl/features/impl/flare.hpp Use autoSelectMethod for sampled-surface search tree.
features/include/pcl/features/impl/cvfh.hpp Use autoSelectMethod for radius-search tree.
examples/segmentation/example_extract_clusters_normals.cpp Add an alternative Conditional Euclidean Clustering example and remove explicit normal-estimation tree wiring.
examples/keypoints/example_sift_z_keypoint_estimation.cpp Remove explicit kdtree wiring for SIFT example.
examples/keypoints/example_sift_normal_keypoint_estimation.cpp Remove explicit kdtree wiring for normals + SIFT example.
examples/keypoints/example_sift_keypoint_estimation.cpp Remove explicit kdtree wiring for SIFT example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread surface/include/pcl/surface/impl/texture_mapping.hpp
Comment thread recognition/include/pcl/recognition/impl/implicit_shape_model.hpp
Comment thread keypoints/include/pcl/keypoints/impl/sift_keypoint.hpp
Comment thread features/include/pcl/features/impl/flare.hpp
Comment thread features/include/pcl/features/impl/cvfh.hpp
Comment thread features/include/pcl/features/impl/our_cvfh.hpp
Comment thread surface/include/pcl/surface/impl/texture_mapping.hpp
@mvieth mvieth merged commit 7f2d8d7 into PointCloudLibrary:master Apr 9, 2026
13 checks passed
@mvieth mvieth deleted the nanoflann_default5 branch April 9, 2026 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: enhancement Meta-information for changelog generation module: search

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants