39 #ifndef PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_LM_H_
40 #define PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_LM_H_
48 namespace registration
56 template <
typename Po
intSource,
typename Po
intTarget>
71 weights_ (), tmp_src_ (), tmp_tgt_ (), tmp_idx_src_ (), tmp_idx_tgt_ (), warp_point_ ()
78 weights_ (src.weights_),
79 tmp_src_ (src.tmp_src_),
80 tmp_tgt_ (src.tmp_tgt_),
81 tmp_idx_src_ (src.tmp_idx_src_),
82 tmp_idx_tgt_ (src.tmp_idx_tgt_),
83 warp_point_ (src.warp_point_)
92 weights_ = src.weights_;
93 tmp_src_ = src.tmp_src_;
94 tmp_tgt_ = src.tmp_tgt_;
95 tmp_idx_src_ = src.tmp_idx_src_;
96 tmp_idx_tgt_ = src.tmp_idx_tgt_;
97 warp_point_ = src.warp_point_;
112 Eigen::Matrix4f &transformation_matrix);
123 const std::vector<int> &indices_src,
125 Eigen::Matrix4f &transformation_matrix);
138 const std::vector<int> &indices_src,
140 const std::vector<int> &indices_tgt,
141 Eigen::Matrix4f &transformation_matrix);
154 Eigen::Matrix4f &transformation_matrix);
162 warp_point_ = warp_fcn;
175 computeDistance (
const PointSource &p_src,
const PointTarget &p_tgt)
183 std::vector<double> weights_;
186 const PointCloudSource *tmp_src_;
189 const PointCloudTarget *tmp_tgt_;
192 const std::vector<int> *tmp_idx_src_;
195 const std::vector<int> *tmp_idx_tgt_;
198 boost::shared_ptr<WarpPointRigid<PointSource, PointTarget> > warp_point_;
204 template<
typename _Scalar,
int NX=Eigen::Dynamic,
int NY=Eigen::Dynamic>
207 typedef _Scalar Scalar;
210 InputsAtCompileTime = NX,
211 ValuesAtCompileTime = NY
213 typedef Eigen::Matrix<Scalar,InputsAtCompileTime,1> InputType;
214 typedef Eigen::Matrix<Scalar,ValuesAtCompileTime,1> ValueType;
215 typedef Eigen::Matrix<Scalar,ValuesAtCompileTime,InputsAtCompileTime> JacobianType;
218 Functor () : m_data_points_ (ValuesAtCompileTime) {}
223 Functor (
int m_data_points) : m_data_points_ (m_data_points) {}
226 virtual ~Functor () {}
230 values ()
const {
return (m_data_points_); }
236 struct OptimizationFunctor :
public Functor<double>
238 using Functor<double>::values;
244 OptimizationFunctor (
int m_data_points, TransformationEstimationLM<PointSource, PointTarget> *estimator) :
245 Functor<double> (m_data_points), estimator_ (estimator) {}
250 inline OptimizationFunctor (
const OptimizationFunctor &src) :
251 Functor<double> (src.m_data_points_), estimator_ ()
259 inline OptimizationFunctor&
262 Functor<double>::operator=(src);
263 estimator_ = src.estimator_;
268 virtual ~OptimizationFunctor () {}
275 operator () (
const Eigen::VectorXd &x, Eigen::VectorXd &fvec)
const;
277 TransformationEstimationLM<PointSource, PointTarget> *estimator_;
280 struct OptimizationFunctorWithIndices :
public Functor<double>
282 using Functor<double>::values;
289 Functor<double> (m_data_points), estimator_ (estimator) {}
294 inline OptimizationFunctorWithIndices (
const OptimizationFunctorWithIndices &src) :
295 Functor<double> (src.m_data_points_), estimator_ ()
303 inline OptimizationFunctorWithIndices&
304 operator = (
const OptimizationFunctorWithIndices &src)
306 Functor<double>::operator=(src);
307 estimator_ = src.estimator_;
312 virtual ~OptimizationFunctorWithIndices () {}
319 operator () (
const Eigen::VectorXd &x, Eigen::VectorXd &fvec)
const;
321 TransformationEstimationLM<PointSource, PointTarget> *estimator_;
324 EIGEN_MAKE_ALIGNED_OPERATOR_NEW