Skip to content

Fix exact PMF height threshold units - #6473

Open
jagrutipatilp wants to merge 1 commit into
PointCloudLibrary:masterfrom
jagrutipatilp:fix/pmf-height-threshold-units
Open

Fix exact PMF height threshold units#6473
jagrutipatilp wants to merge 1 commit into
PointCloudLibrary:masterfrom
jagrutipatilp:fix/pmf-height-threshold-units

Conversation

@jagrutipatilp

@jagrutipatilp jagrutipatilp commented Sep 1, 2026

Copy link
Copy Markdown

Summary

  • Remove the extra cell_size_ multiplier from the exact progressive morphological filter's height-threshold calculation.
  • Add a regression test that verifies classification remains invariant under a uniform coordinate-unit scaling.

Rationale

ProgressiveMorphologicalFilter already computes its window sizes in input-coordinate units:

window_size = cell_size_ * (2.0f * std::pow(base_, iteration) + 1.0f);

The height-threshold calculation then multiplied the difference between two such window sizes by cell_size_ again. With a dimensionless slope, this produced a squared-distance term that was added to initial_distance_, and could change classifications when the same cloud was represented at a different coordinate scale.

The corrected expression applies the slope directly to the window-size difference. This is consistent with the PMF formulation described by Zhang et al., where cell size is used once to convert a window increment expressed in cells.

ApproximateProgressiveMorphologicalFilter is intentionally unchanged: its window sizes are stored as cell counts, so its multiplication by cell_size_ remains necessary.

Regression test

The new test classifies a synthetic raised plateau at scales 1 and 4, scaling the coordinates and all distance-valued parameters together. Before this fix, the extra multiplier gives different ground classifications at the two scales. With the corrected formula, both runs classify the same 13 indices as ground.

Testing

  • git diff --check origin/master...HEAD — passes.
  • The C++ test was not run locally because the required Eigen3, Boost.Iostreams, and GoogleTest development dependencies are unavailable in this environment. Upstream CI should provide build and test coverage.

Follow-up to #6461 and the units discussion.

Exact PMF window sizes are already expressed in input coordinate units. Avoid multiplying their difference by cell size a second time, and add a scale-invariance regression test.
@jagrutipatilp jagrutipatilp changed the title Fix PMF height threshold units Fix exact PMF height threshold units Sep 1, 2026
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.

1 participant