41 #ifndef PCL_FEATURES_IMPL_NORMAL_3D_H_
42 #define PCL_FEATURES_IMPL_NORMAL_3D_H_
44 #include <pcl/features/normal_3d.h>
47 template <
typename Po
intInT,
typename Po
intOutT>
void
53 std::vector<float> nn_dists (k_);
60 for (std::size_t idx = 0; idx < indices_->size (); ++idx)
62 if (this->searchForNeighbors ((*indices_)[idx], search_parameter_, nn_indices, nn_dists) == 0 ||
63 !
computePointNormal (*surface_, nn_indices, output[idx].normal[0], output[idx].normal[1], output[idx].normal[2], output[idx].curvature))
65 output[idx].normal[0] = output[idx].normal[1] = output[idx].normal[2] = output[idx].curvature = std::numeric_limits<float>::quiet_NaN ();
72 output[idx].normal[0], output[idx].normal[1], output[idx].normal[2]);
79 for (std::size_t idx = 0; idx < indices_->size (); ++idx)
81 if (!
isFinite ((*input_)[(*indices_)[idx]]) ||
82 this->searchForNeighbors ((*indices_)[idx], search_parameter_, nn_indices, nn_dists) == 0 ||
83 !
computePointNormal (*surface_, nn_indices, output[idx].normal[0], output[idx].normal[1], output[idx].normal[2], output[idx].curvature))
85 output[idx].normal[0] = output[idx].normal[1] = output[idx].normal[2] = output[idx].curvature = std::numeric_limits<float>::quiet_NaN ();
92 output[idx].normal[0], output[idx].normal[1], output[idx].normal[2]);
98 #define PCL_INSTANTIATE_NormalEstimation(T,NT) template class PCL_EXPORTS pcl::NormalEstimation<T,NT>;
void computeFeature(PointCloudOut &output) override
Estimate normals for all points given in <setInputCloud (), setIndices ()> using the surface in setSe...
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values in any of their floating point fields).
void flipNormalTowardsViewpoint(const PointT &point, float vp_x, float vp_y, float vp_z, Eigen::Matrix< Scalar, 4, 1 > &normal)
Flip (in place) the estimated normal of a point towards a given viewpoint.
bool computePointNormal(const pcl::PointCloud< PointT > &cloud, Eigen::Vector4f &plane_parameters, float &curvature)
Compute the Least-Squares plane fit for a given set of points, and return the estimated plane paramet...
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested return true if f...
IndicesAllocator<> Indices
Type used for indices in PCL.