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_SAMPLE_CONSENSUS_MLESAC_H_
00042 #define PCL_SAMPLE_CONSENSUS_MLESAC_H_
00043
00044 #include <pcl/sample_consensus/sac.h>
00045 #include <pcl/sample_consensus/sac_model.h>
00046
00047 namespace pcl
00048 {
00056 template <typename PointT>
00057 class MaximumLikelihoodSampleConsensus : public SampleConsensus<PointT>
00058 {
00059 typedef typename SampleConsensusModel<PointT>::Ptr SampleConsensusModelPtr;
00060 typedef typename SampleConsensusModel<PointT>::PointCloudConstPtr PointCloudConstPtr;
00061
00062 public:
00063 typedef boost::shared_ptr<MaximumLikelihoodSampleConsensus> Ptr;
00064 typedef boost::shared_ptr<const MaximumLikelihoodSampleConsensus> ConstPtr;
00065
00066 using SampleConsensus<PointT>::max_iterations_;
00067 using SampleConsensus<PointT>::threshold_;
00068 using SampleConsensus<PointT>::iterations_;
00069 using SampleConsensus<PointT>::sac_model_;
00070 using SampleConsensus<PointT>::model_;
00071 using SampleConsensus<PointT>::model_coefficients_;
00072 using SampleConsensus<PointT>::inliers_;
00073 using SampleConsensus<PointT>::probability_;
00074
00078 MaximumLikelihoodSampleConsensus (const SampleConsensusModelPtr &model) :
00079 SampleConsensus<PointT> (model),
00080 iterations_EM_ (3),
00081 sigma_ (0)
00082 {
00083 max_iterations_ = 10000;
00084 }
00085
00090 MaximumLikelihoodSampleConsensus (const SampleConsensusModelPtr &model, double threshold) :
00091 SampleConsensus<PointT> (model, threshold),
00092 iterations_EM_ (3),
00093 sigma_ (0)
00094 {
00095 max_iterations_ = 10000;
00096 }
00097
00101 bool
00102 computeModel (int debug_verbosity_level = 0);
00103
00107 inline void
00108 setEMIterations (int iterations) { iterations_EM_ = iterations; }
00109
00111 inline int
00112 getEMIterations () const { return (iterations_EM_); }
00113
00114
00115 protected:
00125 double
00126 computeMedianAbsoluteDeviation (const PointCloudConstPtr &cloud,
00127 const boost::shared_ptr <std::vector<int> > &indices,
00128 double sigma);
00129
00136 void
00137 getMinMax (const PointCloudConstPtr &cloud,
00138 const boost::shared_ptr <std::vector<int> > &indices,
00139 Eigen::Vector4f &min_p,
00140 Eigen::Vector4f &max_p);
00141
00147 void
00148 computeMedian (const PointCloudConstPtr &cloud,
00149 const boost::shared_ptr <std::vector<int> > &indices,
00150 Eigen::Vector4f &median);
00151
00152 private:
00154 int iterations_EM_;
00156 double sigma_;
00157 };
00158 }
00159
00160 #ifdef PCL_NO_PRECOMPILE
00161 #include <pcl/sample_consensus/impl/mlesac.hpp>
00162 #endif
00163
00164 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MLESAC_H_