Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApproximateProgressiveMorphologicalFilter: check for finite-ness #5756

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

mvieth
Copy link
Member

@mvieth mvieth commented Jul 2, 2023

Otherwise the matrices A and Zf may be accessed with invalid row and col indices.
Fixes #5728

@mvieth mvieth added module: segmentation changelog: fix Meta-information for changelog generation labels Jul 2, 2023
@@ -129,7 +130,9 @@ pcl::ApproximateProgressiveMorphologicalFilter<PointT>::extract (Indices& ground
for (int i = 0; i < static_cast<int>(input_->size ()); ++i)
{
// ...then test for lower points within the cell
PointT p = (*input_)[i];
const PointT& p = (*input_)[i];
if (!pcl::isFinite(p))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to test at line 235 as well - ground indices is the orignally indices input (so could be all points, if not thing is set), which results in a copy of the original cloud, iterated at the mentioned line?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we only keep these checks for algorithms that require ordered point clouds and leave them out of algorithms, that works on unordered - to avoid the performance penalty of checking all points (and this case, twice?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, there is no way to inform the user that its a ill-formed cloud, if we don't check them... so I guess it would bring these issues once in a while.
I guess the best option is to add a "is dense" version of all algorithms, where the user knows what is used as input.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, exactly 😄

@mvieth mvieth merged commit 7a70069 into PointCloudLibrary:master Jul 7, 2023
@mvieth mvieth deleted the apm_filter_finite branch July 7, 2023 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: fix Meta-information for changelog generation module: segmentation
Projects
None yet
2 participants