Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef PCL_COMMON_CORRESPONDENCE_H_
00039 #define PCL_COMMON_CORRESPONDENCE_H_
00040
00041 #ifdef __GNUC__
00042 #pragma GCC system_header
00043 #endif
00044
00045 #include <boost/shared_ptr.hpp>
00046 #include <Eigen/StdVector>
00047 #include <Eigen/Geometry>
00048 #include <pcl/pcl_exports.h>
00049
00050 namespace pcl
00051 {
00058 struct Correspondence
00059 {
00061 int index_query;
00063 int index_match;
00065 union
00066 {
00067 float distance;
00068 float weight;
00069 };
00070
00074 inline Correspondence () : index_query (0), index_match (-1),
00075 distance (std::numeric_limits<float>::max ())
00076 {}
00077
00079 inline Correspondence (int _index_query, int _index_match, float _distance) :
00080 index_query (_index_query), index_match (_index_match), distance (_distance)
00081 {}
00082
00084 virtual ~Correspondence () {}
00085
00086 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00087 };
00088
00090 PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Correspondence& c);
00091
00092 typedef std::vector< pcl::Correspondence, Eigen::aligned_allocator<pcl::Correspondence> > Correspondences;
00093 typedef boost::shared_ptr<Correspondences> CorrespondencesPtr;
00094 typedef boost::shared_ptr<const Correspondences > CorrespondencesConstPtr;
00095
00109 void
00110 getRejectedQueryIndices (const pcl::Correspondences &correspondences_before,
00111 const pcl::Correspondences &correspondences_after,
00112 std::vector<int>& indices,
00113 bool presorting_required = true);
00114
00120 struct PointCorrespondence3D : public Correspondence
00121 {
00122 Eigen::Vector3f point1;
00123 Eigen::Vector3f point2;
00124
00126 PointCorrespondence3D () : point1 (), point2 () {}
00127
00129 virtual ~PointCorrespondence3D () {}
00130
00131 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00132 };
00133 typedef std::vector<PointCorrespondence3D, Eigen::aligned_allocator<PointCorrespondence3D> > PointCorrespondences3DVector;
00134
00140 struct PointCorrespondence6D : public PointCorrespondence3D
00141 {
00142 Eigen::Affine3f transformation;
00143
00144
00145 virtual ~PointCorrespondence6D () {}
00146
00147 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00148 };
00149 typedef std::vector<PointCorrespondence6D, Eigen::aligned_allocator<PointCorrespondence6D> > PointCorrespondences6DVector;
00150
00156 inline bool
00157 isBetterCorrespondence (const Correspondence &pc1, const Correspondence &pc2)
00158 {
00159 return (pc1.distance > pc2.distance);
00160 }
00161 }
00162
00163 #endif