51 if (threshold_ == std::numeric_limits<double>::max())
53 PCL_ERROR (
"[pcl::RandomizedRandomSampleConsensus::computeModel] No threshold set!\n");
59 double k = std::numeric_limits<double>::max();
66 const double one_over_indices = 1.0 /
static_cast<double> (sac_model_->getIndices ()->size ());
71 const unsigned max_skip = max_iterations_ * 10;
74 const std::size_t
fraction_nr_points =
pcl_lrint (
static_cast<double>(sac_model_->getIndices ()->size ()) * fraction_nr_pretest_ / 100.0);
77 while (iterations_ < k)
80 sac_model_->getSamples (iterations_,
selection);
84 PCL_ERROR (
"[pcl::RandomizedRandomSampleConsensus::computeModel] No samples could be selected!\n");
95 PCL_DEBUG (
"[pcl::RandomizedRandomSampleConsensus::computeModel] The function computeModelCoefficients failed, so continue with next iteration.\n");
100 PCL_DEBUG (
"[pcl::RandomizedRandomSampleConsensus::computeModel] The function computeModelCoefficients failed, and RRANSAC reached the maximum number of trials.\n");
111 PCL_DEBUG (
"[pcl::RandomizedRandomSampleConsensus::computeModel] The function doSamplesVerifyModel failed, so continue with next iteration.\n");
138 PCL_DEBUG (
"[pcl::RandomizedRandomSampleConsensus::computeModel] Trial %d out of %d: %u inliers (best is: %u so far).\n", iterations_,
static_cast<int> (std::ceil (k)),
n_inliers_count,
n_best_inliers_count);
139 if (iterations_ > max_iterations_)
142 PCL_DEBUG (
"[pcl::RandomizedRandomSampleConsensus::computeModel] RRANSAC reached the maximum number of trials.\n");
148 PCL_DEBUG (
"[pcl::RandomizedRandomSampleConsensus::computeModel] Model: %lu size, %u inliers.\n", model_.size (),
n_best_inliers_count);
152 PCL_ERROR (
"[pcl::RandomizedRandomSampleConsensus::computeModel] RRANSAC found no model.\n");
158 sac_model_->selectWithinDistance (model_coefficients_, threshold_, inliers_);