Fix PMF maximum window size precision - #6461
Open
tianrking wants to merge 1 commit into
Open
Conversation
ProgressiveMorphologicalFilter computes window sizes in point-cloud coordinate units, but its integer API truncates fractional maximum sizes. Store and return the value as float, document the unit distinction from the approximate filter, and add a regression test.
larshg
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ProgressiveMorphologicalFilter's maximum window size asfloatApproximateProgressiveMorphologicalFilterintentionally uses grid-cell countsMotivation
PMF computes each window size as
cell_size * (2 * base^iteration + 1)and passes that coordinate-space value to the morphological operator. Comparing it with an integer maximum truncates valid fractional thresholds. The approximate implementation has different, existing semantics: its maximum is a number of cells, so this change deliberately leaves that API asint.Fixes #6414
Testing
test_progressive_morphological_filtertarget with GCC 15.2 andPCL_ONLY_CORE_POINT_TYPES=ONgetMaxWindowSize()returnsint, while the updated API compiles asfloatPCL_NO_PRECOMPILEruntime probe; setting6.25freturned6.25g++ -std=c++17 -fsyntax-only test/segmentation/test_progressive_morphological_filter.cppwith the configured PCL include pathsclang-format --dry-run --Werror test/segmentation/test_progressive_morphological_filter.cppgit diff --check