51 template <
typename Po
intSource,
typename Po
intTarget,
typename FeatureT>
100 return (0.5 * threshold_ * (2.0 * fabs (e) - threshold_));
117 return (e / threshold_);
128 input_features_ (), target_features_ (),
129 nr_samples_(3), min_sample_distance_ (0.0f), k_correspondences_ (10),
133 reg_name_ =
"SampleConsensusInitialAlignment";
134 max_iterations_ = 1000;
194 setErrorFunction (
const boost::shared_ptr<ErrorFunctor> & error_functor) { error_functor_ = error_functor; }
199 boost::shared_ptr<ErrorFunctor>
207 getRandomIndex (
int n) {
return (static_cast<int> (n * (rand () / (RAND_MAX + 1.0)))); };
217 selectSamples (
const PointCloudSource &cloud,
int nr_samples,
float min_sample_distance,
218 std::vector<int> &sample_indices);
228 findSimilarFeatures (
const FeatureCloud &input_features,
const std::vector<int> &sample_indices,
229 std::vector<int> &corresponding_indices);
242 computeTransformation (
PointCloudSource &output,
const Eigen::Matrix4f& guess);
254 float min_sample_distance_;
257 int k_correspondences_;
263 boost::shared_ptr<ErrorFunctor> error_functor_;
265 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
271 #endif //#ifndef IA_RANSAC_H_