44 #include <pcl/pcl_base.h>
45 #include <pcl/search/pcl_search.h>
46 #include <pcl/common/common.h>
48 #include <pcl/surface/boost.h>
49 #include <pcl/surface/eigen.h>
50 #include <pcl/surface/processing.h>
64 template <
typename Po
intInT,
typename Po
intOutT>
68 typedef boost::shared_ptr<MovingLeastSquares<PointInT, PointOutT> >
Ptr;
69 typedef boost::shared_ptr<const MovingLeastSquares<PointInT, PointOutT> >
ConstPtr;
90 typedef boost::function<int (int, double, std::vector<int> &, std::vector<float> &)>
SearchMethod;
115 rng_uniform_distribution_ ()
136 int (
KdTree::*radiusSearch)(
int index,
double radius, std::vector<int> &k_indices, std::vector<float> &k_sqr_distances,
unsigned int max_nn)
const = &
KdTree::radiusSearch;
351 MLSResult (
const Eigen::Vector3d &a_mean,
352 const Eigen::Vector3d &a_plane_normal,
353 const Eigen::Vector3d &a_u,
354 const Eigen::Vector3d &a_v,
355 const Eigen::VectorXd a_c_vec,
356 const int a_num_neighbors,
357 const float &a_curvature);
399 index_3d[1] =
static_cast<Eigen::Vector3i::Scalar
> (index_1d /
data_size_);
401 index_3d[2] =
static_cast<Eigen::Vector3i::Scalar
> (index_1d);
407 for (
int i = 0; i < 3; ++i)
412 getPosition (
const uint64_t &index_1d, Eigen::Vector3f &point)
const
414 Eigen::Vector3i index_3d;
416 for (
int i = 0; i < 3; ++i)
465 const std::vector<int> &nn_indices,
466 std::vector<float> &nn_sqr_dists,
470 MLSResult &mls_result)
const;
488 Eigen::Vector3d &u_axis, Eigen::Vector3d &v_axis,
489 Eigen::Vector3d &n_axis,
490 Eigen::Vector3d &mean,
492 Eigen::VectorXd &c_vec,
494 PointOutT &result_point,
499 PointOutT &point_out)
const;
513 boost::mt19937 rng_alg_;
518 boost::shared_ptr<boost::variate_generator<boost::mt19937&,
519 boost::uniform_real<float> >
520 > rng_uniform_distribution_;
523 std::string getClassName ()
const {
return (
"MovingLeastSquares"); }
526 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
536 template <
typename Po
intInT,
typename Po
intOutT>
537 class MovingLeastSquaresOMP:
public MovingLeastSquares<PointInT, PointOutT>
540 typedef boost::shared_ptr<MovingLeastSquares<PointInT, PointOutT> > Ptr;
541 typedef boost::shared_ptr<const MovingLeastSquares<PointInT, PointOutT> > ConstPtr;
545 using MovingLeastSquares<PointInT, PointOutT>::normals_;
546 using MovingLeastSquares<PointInT, PointOutT>::corresponding_input_indices_;
547 using MovingLeastSquares<PointInT, PointOutT>::nr_coeff_;
548 using MovingLeastSquares<PointInT, PointOutT>::order_;
549 using MovingLeastSquares<PointInT, PointOutT>::compute_normals_;
555 typedef typename PointCloudOut::Ptr PointCloudOutPtr;
556 typedef typename PointCloudOut::ConstPtr PointCloudOutConstPtr;
561 MovingLeastSquaresOMP (
unsigned int threads = 0) : threads_ (threads)
570 setNumberOfThreads (
unsigned int threads = 0)
579 virtual void performProcessing (PointCloudOut &output);
582 unsigned int threads_;
587 #ifdef PCL_NO_PRECOMPILE
588 #include <pcl/surface/impl/mls.hpp>