Point Cloud Library (PCL)  1.7.2
cppf.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2011, Alexandru-Eugen Ichim
6  * Copyright (c) 2012-, Open Perception, Inc.
7  * Copyright (c) 2013, Martin Szarski
8  *
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  *
15  * * Redistributions of source code must retain the above copyright
16  * notice, this list of conditions and the following disclaimer.
17  * * Redistributions in binary form must reproduce the above
18  * copyright notice, this list of conditions and the following
19  * disclaimer in the documentation and/or other materials provided
20  * with the distribution.
21  * * Neither the name of the copyright holder(s) nor the names of its
22  * contributors may be used to endorse or promote products derived
23  * from this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
28  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
30  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
33  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  *
38  */
39 
40 #ifndef PCL_CPPF_H_
41 #define PCL_CPPF_H_
42 
43 #include <pcl/features/feature.h>
44 #include <pcl/features/boost.h>
45 
46 namespace pcl
47 {
48  /** \brief
49  * \param[in] p1
50  * \param[in] n1
51  * \param[in] p2
52  * \param[in] n2
53  * \param[in] c1
54  * \param[in] c2
55  * \param[out] f1
56  * \param[out] f2
57  * \param[out] f3
58  * \param[out] f4
59  * \param[out] f5
60  * \param[out] f6
61  * \param[out] f7
62  * \param[out] f8
63  * \param[out] f9
64  * \param[out] f10
65  */
66  PCL_EXPORTS bool
67  computeCPPFPairFeature (const Eigen::Vector4f &p1, const Eigen::Vector4f &n1, const Eigen::Vector4i &c1,
68  const Eigen::Vector4f &p2, const Eigen::Vector4f &n2, const Eigen::Vector4i &c2,
69  float &f1, float &f2, float &f3, float &f4, float &f5, float &f6, float &f7, float &f8, float &f9, float &f10);
70 
71 
72 
73  /** \brief Class that calculates the "surflet" features for each pair in the given
74  * pointcloud. Please refer to the following publication for more details:
75  * C. Choi, Henrik Christensen
76  * 3D Pose Estimation of Daily Objects Using an RGB-D Camera
77  * Proceedings of IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)
78  * 2012
79  *
80  * PointOutT is meant to be pcl::CPPFSignature - contains the 10 values of the Surflet
81  * feature and in addition, alpha_m for the respective pair - optimization proposed by
82  * the authors (see above)
83  *
84  * \author Martin Szarski, Alexandru-Eugen Ichim
85  */
86 
87  template <typename PointInT, typename PointNT, typename PointOutT>
88  class CPPFEstimation : public FeatureFromNormals<PointInT, PointNT, PointOutT>
89  {
90  public:
91  typedef boost::shared_ptr<CPPFEstimation<PointInT, PointNT, PointOutT> > Ptr;
92  typedef boost::shared_ptr<const CPPFEstimation<PointInT, PointNT, PointOutT> > ConstPtr;
98 
100 
101  /** \brief Empty Constructor. */
102  CPPFEstimation ();
103 
104 
105  private:
106  /** \brief The method called for actually doing the computations
107  * \param[out] output the resulting point cloud (which should be of type pcl::CPPFSignature);
108  * its size is the size of the input cloud, squared (i.e., one point for each pair in
109  * the input cloud);
110  */
111  void
112  computeFeature (PointCloudOut &output);
113  };
114 }
115 
116 #ifdef PCL_NO_PRECOMPILE
117 #include <pcl/features/impl/cppf.hpp>
118 #endif
119 
120 #endif // PCL_CPPF_H_
boost::shared_ptr< CPPFEstimation< PointInT, PointNT, PointOutT > > Ptr
Definition: cppf.h:91
PCL_EXPORTS bool computeCPPFPairFeature(const Eigen::Vector4f &p1, const Eigen::Vector4f &n1, const Eigen::Vector4i &c1, const Eigen::Vector4f &p2, const Eigen::Vector4f &n2, const Eigen::Vector4i &c2, float &f1, float &f2, float &f3, float &f4, float &f5, float &f6, float &f7, float &f8, float &f9, float &f10)
Class that calculates the "surflet" features for each pair in the given pointcloud.
Definition: cppf.h:88
CPPFEstimation()
Empty Constructor.
Definition: cppf.hpp:49
PCL base class.
Definition: pcl_base.h:68
boost::shared_ptr< const CPPFEstimation< PointInT, PointNT, PointOutT > > ConstPtr
Definition: cppf.h:92
PointCloud represents the base class in PCL for storing collections of 3D points. ...
pcl::PointCloud< PointOutT > PointCloudOut
Definition: cppf.h:99
Feature represents the base feature class.
Definition: feature.h:105