Skip to content

Fix PMF maximum window size precision - #6461

Open
tianrking wants to merge 1 commit into
PointCloudLibrary:masterfrom
tianrking:codex/fix-pmf-window-size-units
Open

Fix PMF maximum window size precision#6461
tianrking wants to merge 1 commit into
PointCloudLibrary:masterfrom
tianrking:codex/fix-pmf-window-size-units

Conversation

@tianrking

Copy link
Copy Markdown

Summary

  • store ProgressiveMorphologicalFilter's maximum window size as float
  • document that PMF uses input-coordinate units while ApproximateProgressiveMorphologicalFilter intentionally uses grid-cell counts
  • add a regression test that checks both the API type and preservation of a fractional value

Motivation

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 as int.

Fixes #6414

Testing

  • built and linked the new test_progressive_morphological_filter target with GCC 15.2 and PCL_ONLY_CORE_POINT_TYPES=ON
  • confirmed a baseline type probe fails because getMaxWindowSize() returns int, while the updated API compiles as float
  • ran a PCL_NO_PRECOMPILE runtime probe; setting 6.25f returned 6.25
  • g++ -std=c++17 -fsyntax-only test/segmentation/test_progressive_morphological_filter.cpp with the configured PCL include paths
  • clang-format --dry-run --Werror test/segmentation/test_progressive_morphological_filter.cpp
  • git diff --check

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.
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.

[ProgressiveMorphologicalFilter] Max window size considered as int instead of double (number of cells rather than dimension)

2 participants