do not convolve if nb neighbors <= 0

This commit is contained in:
Sébastien Loriot 2015-05-19 16:09:41 +02:00
parent bb9521a288
commit bdba9d2c7c
1 changed files with 13 additions and 9 deletions

View File

@ -325,16 +325,20 @@ vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input
20,
kernel);
std::vector<Covariance> ccov;
internal::vcm_convolve(first, beyond,
point_pmap,
cov,
ccov,
(unsigned int) nb_neighbors_convolve,
kernel);
if (nb_neighbors_convolve > 0)
{
std::vector<Covariance> ccov;
ccov.reserve(cov.size());
internal::vcm_convolve(first, beyond,
point_pmap,
cov,
ccov,
(unsigned int) nb_neighbors_convolve,
kernel);
cov.clear();
std::copy(ccov.begin(), ccov.end(), std::back_inserter(cov));
cov.clear();
std::copy(ccov.begin(), ccov.end(), std::back_inserter(cov));
}
}
// And finally, compute the normals