Repository navigation
Fix PMF maximum window size precision - #6461
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.
|
While validating this change, I noticed a follow-up units issue in the exact
In Equation (7) of Zhang et al. (2003), the multiplication by cell size is needed because I prepared a focused one-line fix that removes the extra |
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