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_->points.size () != input_->points.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_->points.size () != input_->points.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 (
size_t point_id = 0; point_id < input_->points.size (); ++point_id)
90 output.
points[point_id].getNormalVector3fMap () = (input_normals_small_->points[point_id].getNormalVector3fMap ()
91 - input_normals_large_->points[point_id].getNormalVector3fMap ()) / 2.0;
92 if(!pcl_isfinite (output.
points[point_id].normal_x) ||
93 !pcl_isfinite (output.
points[point_id].normal_y) ||
94 !pcl_isfinite (output.
points[point_id].normal_z)){
95 output.
points[point_id].getNormalVector3fMap () = Eigen::Vector3f(0,0,0);
97 output.
points[point_id].curvature = output.
points[point_id].getNormalVector3fMap ().norm();
102 #define PCL_INSTANTIATE_DifferenceOfNormalsEstimation(T,NT,OutT) template class PCL_EXPORTS pcl::DifferenceOfNormalsEstimation<T,NT,OutT>;
104 #endif // PCL_FILTERS_DON_H_
std::vector< PointT, Eigen::aligned_allocator< PointT > > points
The point data.
virtual void computeFeature(PointCloudOut &output)
Computes the DoN vector for each point in the input point cloud and outputs the vector cloud to the g...
virtual bool initCompute()
Initialize for computation of features.
Feature represents the base feature class.
PointCloud represents the base class in PCL for storing collections of 3D points. ...