Skip to content

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

@Alessio-Parmeggiani

Description

@Alessio-Parmeggiani

Describe the bug
In the progressive morphological filter implementation I see that there is the following snippet of code to compute the different window sizes to use.

while (window_size < max_window_size_)
{
// Determine the initial window size.
if (exponential_)
window_size = cell_size_ * (2.0f * std::pow (base_, iteration) + 1.0f);
else
window_size = cell_size_ * (2.0f * (iteration+1) * base_ + 1.0f);

I think there is an error in how max_window_size is being considered.
From the code window_size is treated as a dimension quantity (e.g. meters) while max window size is stored as an int, as if it represents the number of cells rather than the maximum dimension of a window size. So for me it is wrong that they are compared directly.

Expected behavior

I would expect max_window_size to be a float or double like window_size and represent the maximum dimension of the window size.

Another possibility is to keep max_window_size as an int but consider it using something like:
while (window_size < max_window_size_ * cell_size)
so that dimensions are coherent.

Your Environment

  • PCL Version 1.12 but the same is visible also in other versions

Other context
The same is true also for ApproximateProgressiveMorphologicalFilter

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions