Skip to content

Modify FlannSearch to return Indices of Point Cloud (issue #5774)#5780

Merged
mvieth merged 4 commits intoPointCloudLibrary:masterfrom
GaspTO:FixFLannSearchIndicesReturn
Aug 13, 2023
Merged

Modify FlannSearch to return Indices of Point Cloud (issue #5774)#5780
mvieth merged 4 commits intoPointCloudLibrary:masterfrom
GaspTO:FixFLannSearchIndicesReturn

Conversation

@GaspTO
Copy link
Copy Markdown
Contributor

@GaspTO GaspTO commented Aug 2, 2023

FlannSearch was returning, in the radiusSearch and nearestKSearch, the Indices of the Indices passed, which is inconsistent with the other search classes. This solves issue #5774.

I'm just opening the PR to start the discussion on this change. I'm still trying to understand and run the tests. As said, though, the change itself is not that complicated, it was two lines of code, unless there is something I am not seeing.

FlannSearch was returning, in the radiusSearch and
NearestKSearch, the Indices of the Indices passed,
which is inconsistent with the other search clases.
@mvieth
Copy link
Copy Markdown
Member

mvieth commented Aug 5, 2023

Looks good so far. Would you also be willing to extend test/search/test_search.cpp ? I think you would just have to check what is done for KdTree and do the same for FlannSearch, and then we see whether the test passes in our CI pipeline.

@mvieth mvieth added module: search changelog: fix Meta-information for changelog generation labels Aug 5, 2023
@GaspTO
Copy link
Copy Markdown
Contributor Author

GaspTO commented Aug 7, 2023

Yes, I can extend test/search/test_search.cpp .

Correct bug when k > input_ size
@GaspTO
Copy link
Copy Markdown
Contributor Author

GaspTO commented Aug 8, 2023

When I extend the tests, the flannsearch fails in the radiusSearch when k is bigger than the total points in the index. This is because flannsearch pads the indices returned. So, for example, if the index has 117 points available, and k = 512, the other search methods will return an indice sized 117, but flannsearch returns the indices with size 512.

To solve this, I followed the same reasoning as in the KDTree

Comment thread search/include/pcl/search/flann_search.h Outdated
Copy link
Copy Markdown
Member

@mvieth mvieth left a comment

Choose a reason for hiding this comment

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

Great, thank you!

@mvieth mvieth merged commit b520a83 into PointCloudLibrary:master Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants