00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef PCL_FEATURES_IMPL_NORMAL_3D_TBB_H_
00039 #define PCL_FEATURES_IMPL_NORMAL_3D_TBB_H_
00040
00041 #include "pcl/features/normal_3d_tbb.h"
00042
00044 template <typename PointInT, typename PointOutT> void
00045 pcl::TBB_NormalEstimationTBB<PointInT, PointOutT>::operator () (const tbb::blocked_range <size_t> &r) const
00046 {
00047 float vpx, vpy, vpz;
00048 feature_->getViewPoint (vpx, vpy, vpz);
00049
00050 for (size_t idx = r.begin (); idx != r.end (); ++idx)
00051 {
00052 std::vector<int> nn_indices (feature_->getKSearch ());
00053 std::vector<float> nn_dists (feature_->getKSearch ());
00054
00055 feature_->searchForNeighbors ((*feature_->getIndices ())[idx], feature_->getSearchParameter (), nn_indices, nn_dists);
00056
00057
00058 Eigen::Vector4f xyz_centroid;
00059
00060 compute3DCentroid (*feature_->getSearchSurface (), nn_indices, xyz_centroid);
00061
00062
00063 EIGEN_ALIGN16 Eigen::Matrix3f covariance_matrix;
00064
00065 computeCovarianceMatrix (*feature_->getSearchSurface (), nn_indices, xyz_centroid, covariance_matrix);
00066
00067
00068 solvePlaneParameters (covariance_matrix,
00069 output_.points[idx].normal[0], output_.points[idx].normal[1], output_.points[idx].normal[2], output_.points[idx].curvature);
00070
00071 flipNormalTowardsViewpoint<PointInT> (feature_->getSearchSurface ()->points[idx], vpx, vpy, vpz,
00072 output_.points[idx].normal[0], output_.points[idx].normal[1], output_.points[idx].normal[2]);
00073 }
00074 }
00075
00076 #define PCL_INSTANTIATE_TBB_NormalEstimationTBB(T,NT) template class pcl::TBB_NormalEstimationTBB<T,NT>;
00077 #define PCL_INSTANTIATE_NormalEstimationTBB(T,NT) template class pcl::NormalEstimationTBB<T,NT>;
00078
00079 #endif // PCL_FEATURES_IMPL_NORMAL_3D_TBB_H_
00080