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 
00039 
00040 
00041 #ifndef PCL_APPS_IN_HAND_SCANNER_ICP_H
00042 #define PCL_APPS_IN_HAND_SCANNER_ICP_H
00043 
00044 #include <pcl/pcl_exports.h>
00045 #include <pcl/apps/in_hand_scanner/boost.h>
00046 #include <pcl/apps/in_hand_scanner/eigen.h>
00047 #include <pcl/apps/in_hand_scanner/common_types.h>
00048 
00050 
00052 
00053 namespace pcl
00054 {
00055   template <typename PointT>
00056   class KdTree;
00057 } 
00058 
00060 
00062 
00063 namespace pcl
00064 {
00065   namespace ihs
00066   {
00071     class PCL_EXPORTS ICP
00072     {
00073       public:
00074 
00075         typedef pcl::PointXYZRGBNormal              PointXYZRGBNormal;
00076         typedef pcl::PointCloud <PointXYZRGBNormal> CloudXYZRGBNormal;
00077         typedef CloudXYZRGBNormal::Ptr              CloudXYZRGBNormalPtr;
00078         typedef CloudXYZRGBNormal::ConstPtr         CloudXYZRGBNormalConstPtr;
00079 
00080         typedef pcl::ihs::Mesh         Mesh;
00081         typedef pcl::ihs::MeshPtr      MeshPtr;
00082         typedef pcl::ihs::MeshConstPtr MeshConstPtr;
00083 
00085         ICP ();
00086 
00091         void
00092         setEpsilon (const float epsilon);
00093 
00094         float
00095         getEpsilon () const;
00102         void
00103         setMaxIterations (const unsigned int max_iter);
00104 
00105         unsigned int
00106         getMaxIterations () const;
00113         void
00114         setMinOverlap (const float overlap);
00115 
00116         float
00117         getMinOverlap () const;
00124         void
00125         setMaxFitness (const float fitness);
00126 
00127         float
00128         getMaxFitness () const;
00135         void
00136         setCorrespondenceRejectionFactor (const float factor);
00137 
00138         float
00139         getCorrespondenceRejectionFactor () const;
00146         void
00147         setMaxAngle (const float angle);
00148 
00149         float
00150         getMaxAngle () const;
00160         bool
00161         findTransformation (const MeshConstPtr&              mesh_model,
00162                             const CloudXYZRGBNormalConstPtr& cloud_data,
00163                             const Eigen::Matrix4f&           T_init,
00164                             Eigen::Matrix4f&                 T_final);
00165 
00166       private:
00167 
00168         typedef pcl::PointNormal              PointNormal;
00169         typedef pcl::PointCloud <PointNormal> CloudNormal;
00170         typedef CloudNormal::Ptr              CloudNormalPtr;
00171         typedef CloudNormal::ConstPtr         CloudNormalConstPtr;
00172 
00173         typedef pcl::KdTree <PointNormal>        KdTree;
00174         typedef boost::shared_ptr <KdTree>       KdTreePtr;
00175         typedef boost::shared_ptr <const KdTree> KdTreeConstPtr;
00176 
00182         CloudNormalConstPtr
00183         selectModelPoints (const MeshConstPtr&    mesh_model,
00184                            const Eigen::Matrix4f& T_inv) const;
00185 
00190         CloudNormalConstPtr
00191         selectDataPoints (const CloudXYZRGBNormalConstPtr& cloud_data) const;
00192 
00199         bool
00200         minimizePointPlane (const CloudNormal& cloud_source,
00201                             const CloudNormal& cloud_target,
00202                             Eigen::Matrix4f&   T) const;
00203 
00205         
00207 
00208         KdTreePtr kd_tree_;
00209 
00210         
00211         float epsilon_; 
00212 
00213         
00214         unsigned int max_iterations_;
00215         float min_overlap_; 
00216         float max_fitness_; 
00217 
00218         
00219         float factor_;
00220         float max_angle_; 
00221     };
00222   } 
00223 } 
00224 
00225 #endif // PCL_APPS_IN_HAND_SCANNER_ICP_H