37 #ifndef PCL_FILTERS_DON_IMPL_H_
38 #define PCL_FILTERS_DON_IMPL_H_
40 #include <pcl/features/don.h>
43 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
bool
47 if (!input_normals_small_)
49 PCL_ERROR (
"[pcl::%s::initCompute] No input dataset containing small support radius normals was given!\n", getClassName().c_str ());
54 if (!input_normals_large_)
56 PCL_ERROR (
"[pcl::%s::initCompute] No input dataset containing large support radius normals was given!\n", getClassName().c_str ());
62 if (input_normals_small_->size () != input_->size ())
64 PCL_ERROR (
"[pcl::%s::initCompute] ", getClassName().c_str ());
65 PCL_ERROR (
"The number of points in the input dataset differs from ");
66 PCL_ERROR (
"the number of points in the dataset containing the small support radius normals!\n");
71 if (input_normals_large_->size () != input_->size ())
73 PCL_ERROR (
"[pcl::%s::initCompute] ", getClassName().c_str ());
74 PCL_ERROR (
"The number of points in the input dataset differs from ");
75 PCL_ERROR (
"the number of points in the dataset containing the large support radius normals!\n");
84 template <
typename Po
intInT,
typename Po
intNT,
typename Po
intOutT>
void
88 for (std::size_t point_id = 0; point_id < input_->size (); ++point_id)
90 output[point_id].getNormalVector3fMap () = ((*input_normals_small_)[point_id].getNormalVector3fMap ()
91 - (*input_normals_large_)[point_id].getNormalVector3fMap ()) / 2.0;
92 if(!std::isfinite (output[point_id].normal_x) ||
93 !std::isfinite (output[point_id].normal_y) ||
94 !std::isfinite (output[point_id].normal_z)){
95 output[point_id].getNormalVector3fMap () = Eigen::Vector3f(0,0,0);
97 output[point_id].curvature = output[point_id].getNormalVector3fMap ().norm();
102 #define PCL_INSTANTIATE_DifferenceOfNormalsEstimation(T,NT,OutT) template class PCL_EXPORTS pcl::DifferenceOfNormalsEstimation<T,NT,OutT>;
bool initCompute() override
Initialize for computation of features.
void computeFeature(PointCloudOut &output) override
Computes the DoN vector for each point in the input point cloud and outputs the vector cloud to the g...
Feature represents the base feature class.