-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Conversation
@@ -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)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, exactly 😄
Otherwise the matrices
A
andZf
may be accessed with invalidrow
andcol
indices.Fixes #5728