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 #ifndef PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SAMPLE_CONSENSUS_2D_H_
00040 #define PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SAMPLE_CONSENSUS_2D_H_
00041
00042 #include <pcl/registration/correspondence_rejection_sample_consensus.h>
00043
00044 namespace pcl
00045 {
00046 namespace registration
00047 {
00054 template <typename PointT>
00055 class CorrespondenceRejectorSampleConsensus2D: public CorrespondenceRejectorSampleConsensus<PointT>
00056 {
00057 typedef pcl::PointCloud<PointT> PointCloud;
00058 typedef typename PointCloud::Ptr PointCloudPtr;
00059 typedef typename PointCloud::ConstPtr PointCloudConstPtr;
00060
00061 public:
00062 using CorrespondenceRejectorSampleConsensus<PointT>::refine_;
00063 using CorrespondenceRejectorSampleConsensus<PointT>::input_;
00064 using CorrespondenceRejectorSampleConsensus<PointT>::target_;
00065 using CorrespondenceRejectorSampleConsensus<PointT>::input_correspondences_;
00066 using CorrespondenceRejectorSampleConsensus<PointT>::rejection_name_;
00067 using CorrespondenceRejectorSampleConsensus<PointT>::getClassName;
00068 using CorrespondenceRejectorSampleConsensus<PointT>::inlier_threshold_;
00069 using CorrespondenceRejectorSampleConsensus<PointT>::max_iterations_;
00070 using CorrespondenceRejectorSampleConsensus<PointT>::best_transformation_;
00071
00072 typedef boost::shared_ptr<CorrespondenceRejectorSampleConsensus2D> Ptr;
00073 typedef boost::shared_ptr<const CorrespondenceRejectorSampleConsensus2D> ConstPtr;
00074
00078 CorrespondenceRejectorSampleConsensus2D ()
00079 : projection_matrix_ (Eigen::Matrix3f::Identity ())
00080 {
00081 rejection_name_ = "CorrespondenceRejectorSampleConsensus2D";
00082
00083
00084
00085
00086
00087 }
00088
00093 inline void
00094 getRemainingCorrespondences (const pcl::Correspondences& original_correspondences,
00095 pcl::Correspondences& remaining_correspondences);
00096
00101 inline void
00102 setFocalLengths (const float fx, const float fy)
00103 {
00104 projection_matrix_ (0, 0) = fx;
00105 projection_matrix_ (1, 1) = fy;
00106 }
00107
00112 inline void
00113 getFocalLengths (float &fx, float &fy) const
00114 {
00115 fx = projection_matrix_ (0, 0);
00116 fy = projection_matrix_ (1, 1);
00117 }
00118
00119
00124 inline void
00125 setCameraCenters (const float cx, const float cy)
00126 {
00127 projection_matrix_ (0, 2) = cx;
00128 projection_matrix_ (1, 2) = cy;
00129 }
00130
00135 inline void
00136 getCameraCenters (float &cx, float &cy) const
00137 {
00138 cx = projection_matrix_ (0, 2);
00139 cy = projection_matrix_ (1, 2);
00140 }
00141
00142 protected:
00143
00147 inline void
00148 applyRejection (pcl::Correspondences &correspondences)
00149 {
00150 getRemainingCorrespondences (*input_correspondences_, correspondences);
00151 }
00152
00154 Eigen::Matrix3f projection_matrix_;
00155
00156 public:
00157 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
00158 };
00159 }
00160 }
00161
00162 #include <pcl/registration/impl/correspondence_rejection_sample_consensus_2d.hpp>
00163
00164 #endif // PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SAMPLE_CONSENSUS_2D_H_
00165