40 #ifndef PCL_SAMPLE_CONSENSUS_MODEL_SPHERE_H_
41 #define PCL_SAMPLE_CONSENSUS_MODEL_SPHERE_H_
58 template <
typename Po
intT>
72 typedef boost::shared_ptr<SampleConsensusModelSphere>
Ptr;
105 tmp_inliers_ = source.tmp_inliers_;
117 Eigen::VectorXf &model_coefficients);
125 std::vector<double> &distances);
134 const double threshold,
135 std::vector<int> &inliers);
145 const double threshold);
155 const Eigen::VectorXf &model_coefficients,
156 Eigen::VectorXf &optimized_coefficients);
167 const Eigen::VectorXf &model_coefficients,
169 bool copy_data_fields =
true);
178 const Eigen::VectorXf &model_coefficients,
179 const double threshold);
189 isModelValid (
const Eigen::VectorXf &model_coefficients)
192 if (model_coefficients.size () != 4)
194 PCL_ERROR (
"[pcl::SampleConsensusModelSphere::isModelValid] Invalid number of model coefficients given (%zu)!\n", model_coefficients.size ());
198 if (radius_min_ != -std::numeric_limits<double>::max() && model_coefficients[3] < radius_min_)
200 if (radius_max_ != std::numeric_limits<double>::max() && model_coefficients[3] > radius_max_)
211 isSampleGood(
const std::vector<int> &samples)
const;
215 const std::vector<int> *tmp_inliers_;
217 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
218 #pragma GCC diagnostic ignored "-Weffc++"
228 pcl::
Functor<float>(m_data_points), model_ (model) {}
236 operator() (
const Eigen::VectorXf &x, Eigen::VectorXf &fvec)
const
238 Eigen::Vector4f cen_t;
240 for (
int i = 0; i <
values (); ++i)
243 cen_t[0] = model_->input_->points[(*model_->tmp_inliers_)[i]].x - x[0];
244 cen_t[1] = model_->input_->points[(*model_->tmp_inliers_)[i]].y - x[1];
245 cen_t[2] = model_->input_->points[(*model_->tmp_inliers_)[i]].z - x[2];
248 fvec[i] = sqrtf (cen_t.dot (cen_t)) - x[3];
255 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
256 #pragma GCC diagnostic warning "-Weffc++"
261 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MODEL_SPHERE_H_