Is your feature request related to a problem? Please describe.
Code using NormalEstimationOMP built with PCL 1.14, RelWithDebInfo + -march=native.
Profiled with perf, I see that around 30% of the time spent is calling pcl::isFinite().

Context
Trying to compute cloud normals with NormalEstimationOMP at a predetermined loop rate for traversability estimation purposes (autonomous navigation).
Expected behavior
Some time savings, like the possibility to precompute isFinite() once and looking it up when needed.
Current Behavior
|
for (; xEnd != yEnd; idx += skip, xEnd += input_->width) |
|
{ |
|
for (; idx < xEnd; ++idx) |
|
{ |
|
if (!mask_[idx] || !isFinite ((*input_)[idx])) |
|
continue; |
here isFinite is called for every point in the RadiusSearchBox: this also means that a point may be checked multiple times!
|
for (const auto &index : indices) |
|
{ |
|
if (!isFinite (cloud[index])) |
|
continue; |
here we call again isFinite.
Both the above linked codepaths are called by NormalEstimationOMP.
Describe the solution you'd like
Both the above linked codepaths are called by NormalEstimationOMP. This means that we may choose to pre-compute over the whole cloud an isFinite matrix/mask, propagate it to both code snippets above to look up such values.
Is your feature request related to a problem? Please describe.
Code using

NormalEstimationOMPbuilt with PCL 1.14,RelWithDebInfo+-march=native.Profiled with perf, I see that around 30% of the time spent is calling
pcl::isFinite().Context
Trying to compute cloud normals with
NormalEstimationOMPat a predetermined loop rate for traversability estimation purposes (autonomous navigation).Expected behavior
Some time savings, like the possibility to precompute
isFinite()once and looking it up when needed.Current Behavior
pcl/search/include/pcl/search/impl/organized.hpp
Lines 81 to 86 in 56a3172
here
isFiniteis called for every point in the RadiusSearchBox: this also means that a point may be checked multiple times!pcl/common/include/pcl/common/impl/centroid.hpp
Lines 615 to 618 in 56a3172
here we call again
isFinite.Both the above linked codepaths are called by
NormalEstimationOMP.Describe the solution you'd like
Both the above linked codepaths are called by
NormalEstimationOMP. This means that we may choose to pre-compute over the whole cloud anisFinitematrix/mask, propagate it to both code snippets above to look up such values.