Point Cloud Library (PCL)  1.9.0-dev
transformation_estimation_3point.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2014-, Open Perception, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the copyright holder(s) nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 #ifndef PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_3POINT_H_
38 #define PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_3POINT_H_
39 
40 #include <pcl/registration/transformation_estimation.h>
41 
42 namespace pcl
43 {
44  namespace registration
45  {
46  /** \brief TransformationEstimation3Points represents the class for transformation estimation based on:
47  * - correspondence vectors of 3 pairs (planar case)
48  * - two point clouds (source and target) of size 3
49  * - a point cloud with a set of 3 indices (source), and another point cloud (target)
50  * - two point clouds with two sets of indices (source and target) of the size 3
51  *
52  * \note The class is templated on the source and target point types as well as on the output scalar of the transformation matrix
53  * (i.e., float or double). Default: float.
54  *
55  * \author P.W.Theiler
56  * \ingroup registration
57  */
58  template <typename PointSource, typename PointTarget, typename Scalar = float>
59  class TransformationEstimation3Point : public TransformationEstimation <PointSource, PointTarget, Scalar>
60  {
61  public:
62  /** \cond */
63  typedef boost::shared_ptr<TransformationEstimation3Point<PointSource, PointTarget, Scalar> > Ptr;
64  typedef boost::shared_ptr<const TransformationEstimation3Point<PointSource, PointTarget, Scalar> > ConstPtr;
66  /** \endcond */
67 
68  /** \brief Constructor */
70  {};
71 
72  /** \brief Destructor */
74  {};
75 
76  /** \brief Estimate a rigid rotation transformation between a source and a target point cloud.
77  * \param[in] cloud_src the source point cloud dataset
78  * \param[in] cloud_tgt the target point cloud dataset
79  * \param[out] transformation_matrix the resultant transformation matrix
80  */
81  virtual void
83  const pcl::PointCloud<PointSource> &cloud_src,
84  const pcl::PointCloud<PointTarget> &cloud_tgt,
85  Matrix4 &transformation_matrix) const;
86 
87  /** \brief Estimate a rigid rotation transformation between a source and a target point cloud.
88  * \param[in] cloud_src the source point cloud dataset
89  * \param[in] indices_src the vector of indices describing the points of interest in \a cloud_src
90  * \param[in] cloud_tgt the target point cloud dataset
91  * \param[out] transformation_matrix the resultant transformation matrix
92  */
93  virtual void
95  const pcl::PointCloud<PointSource> &cloud_src,
96  const std::vector<int> &indices_src,
97  const pcl::PointCloud<PointTarget> &cloud_tgt,
98  Matrix4 &transformation_matrix) const;
99 
100  /** \brief Estimate a rigid rotation transformation between a source and a target point cloud.
101  * \param[in] cloud_src the source point cloud dataset
102  * \param[in] indices_src the vector of indices describing the points of interest in \a cloud_src
103  * \param[in] cloud_tgt the target point cloud dataset
104  * \param[in] indices_tgt the vector of indices describing the correspondences of the interest points from \a indices_src
105  * \param[out] transformation_matrix the resultant transformation matrix
106  */
107  virtual void
109  const pcl::PointCloud<PointSource> &cloud_src,
110  const std::vector<int> &indices_src,
111  const pcl::PointCloud<PointTarget> &cloud_tgt,
112  const std::vector<int> &indices_tgt,
113  Matrix4 &transformation_matrix) const;
114 
115  /** \brief Estimate a rigid rotation transformation between a source and a target point cloud.
116  * \param[in] cloud_src the source point cloud dataset
117  * \param[in] cloud_tgt the target point cloud dataset
118  * \param[in] correspondences the vector of correspondences between source and target point cloud
119  * \param[out] transformation_matrix the resultant transformation matrix
120  */
121  virtual void
123  const pcl::PointCloud<PointSource> &cloud_src,
124  const pcl::PointCloud<PointTarget> &cloud_tgt,
125  const pcl::Correspondences &correspondences,
126  Matrix4 &transformation_matrix) const;
127 
128  protected:
129 
130  /** \brief Estimate a rigid rotation transformation between a source and a target
131  * \param[in] source_it an iterator over the source point cloud dataset
132  * \param[in] target_it an iterator over the target point cloud dataset
133  * \param[out] transformation_matrix the resultant transformation matrix
134  */
135  void
138  Matrix4 &transformation_matrix) const;
139  };
140  }; // namespace registration
141 }; // namespace registration
142 
143 #include <pcl/registration/impl/transformation_estimation_3point.hpp>
144 
145 #endif // PCL_REGISTRATION_TRANSFORMATION_ESTIMATION_3POINT_H_
Iterator class for point clouds with or without given indices.
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
boost::shared_ptr< TransformationEstimation< PointSource, PointTarget, Scalar > > Ptr
TransformationEstimation3Points represents the class for transformation estimation based on: ...
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
virtual void estimateRigidTransformation(const pcl::PointCloud< PointSource > &cloud_src, const pcl::PointCloud< PointTarget > &cloud_tgt, Matrix4 &transformation_matrix) const
Estimate a rigid rotation transformation between a source and a target point cloud.
boost::shared_ptr< const TransformationEstimation< PointSource, PointTarget, Scalar > > ConstPtr
TransformationEstimation represents the base class for methods for transformation estimation based on...