39 #ifndef PCL_INTEGRALIMAGE_BASED_NORMAL_ESTIMATOR_H_
40 #define PCL_INTEGRALIMAGE_BASED_NORMAL_ESTIMATOR_H_
42 #include <pcl/point_cloud.h>
44 #include <pcl/features/feature.h>
45 #include <pcl/features/integral_image2D.h>
47 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
48 #pragma GCC diagnostic ignored "-Weffc++"
67 template <
typename Po
intInT,
typename Po
intOutT>
77 typedef boost::shared_ptr<IntegralImageNormalEstimation<PointInT, PointOutT> >
Ptr;
78 typedef boost::shared_ptr<const IntegralImageNormalEstimation<PointInT, PointOutT> >
ConstPtr;
113 , rect_width_ (0), rect_width_2_ (0), rect_width_4_ (0)
114 , rect_height_ (0), rect_height_2_ (0), rect_height_4_ (0)
115 , distance_threshold_ (0)
116 , integral_image_DX_ (false)
117 , integral_image_DY_ (false)
118 , integral_image_depth_ (false)
119 , integral_image_XYZ_ (true)
123 , distance_map_ (NULL)
124 , use_depth_dependent_smoothing_ (false)
125 , max_depth_change_factor_ (20.0f*0.001f)
126 , normal_smoothing_size_ (10.0f)
127 , init_covariance_matrix_ (false)
128 , init_average_3d_gradient_ (false)
129 , init_simple_3d_gradient_ (false)
130 , init_depth_change_ (false)
134 , use_sensor_origin_ (true)
157 border_policy_ = border_policy;
167 computePointNormal (
const int pos_x,
const int pos_y,
const unsigned point_index, PointOutT &normal);
185 max_depth_change_factor_ = max_depth_change_factor;
195 if (normal_smoothing_size <= 0)
197 PCL_ERROR (
"[pcl::%s::setNormalSmoothingSize] Invalid normal smoothing size given! (%f). Allowed ranges are: 0 < N. Defaulting to %f.\n",
198 feature_name_.c_str (), normal_smoothing_size, normal_smoothing_size_);
201 normal_smoothing_size_ = normal_smoothing_size;
219 normal_estimation_method_ = normal_estimation_method;
228 use_depth_dependent_smoothing_ = use_depth_dependent_smoothing;
238 if (!cloud->isOrganized ())
240 PCL_ERROR (
"[pcl::IntegralImageNormalEstimation::setInputCloud] Input dataset is not organized (height = 1).\n");
244 init_covariance_matrix_ = init_average_3d_gradient_ = init_depth_change_ =
false;
246 if (use_sensor_origin_)
248 vpx_ =
input_->sensor_origin_.coeff (0);
249 vpy_ =
input_->sensor_origin_.coeff (1);
250 vpz_ =
input_->sensor_origin_.coeff (2);
262 return (distance_map_);
276 use_sensor_origin_ =
false;
302 use_sensor_origin_ =
true;
305 vpx_ =
input_->sensor_origin_.coeff (0);
306 vpy_ =
input_->sensor_origin_.coeff (1);
307 vpz_ =
input_->sensor_origin_.coeff (2);
358 flipNormalTowardsViewpoint (
const PointInT &point,
359 float vp_x,
float vp_y,
float vp_z,
360 float &nx,
float &ny,
float &nz)
368 float cos_theta = (vp_x * nx + vp_y * ny + vp_z * nz);
400 float distance_threshold_;
403 IntegralImage2D<float, 3> integral_image_DX_;
405 IntegralImage2D<float, 3> integral_image_DY_;
407 IntegralImage2D<float, 1> integral_image_depth_;
409 IntegralImage2D<float, 3> integral_image_XYZ_;
420 float *distance_map_;
423 bool use_depth_dependent_smoothing_;
426 float max_depth_change_factor_;
429 float normal_smoothing_size_;
432 bool init_covariance_matrix_;
435 bool init_average_3d_gradient_;
438 bool init_simple_3d_gradient_;
441 bool init_depth_change_;
445 float vpx_, vpy_, vpz_;
448 bool use_sensor_origin_;
456 initCovarianceMatrixMethod ();
460 initAverage3DGradientMethod ();
464 initAverageDepthChangeMethod ();
468 initSimple3DGradientMethod ();
471 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
474 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
475 #pragma GCC diagnostic warning "-Weffc++"
478 #ifdef PCL_NO_PRECOMPILE
479 #include <pcl/features/impl/integral_image_normal.hpp>