41 #ifndef PCL_SAMPLE_CONSENSUS_MODEL_SPHERE_H_
42 #define PCL_SAMPLE_CONSENSUS_MODEL_SPHERE_H_
44 #include <pcl/sample_consensus/sac_model.h>
45 #include <pcl/sample_consensus/model_types.h>
59 template <
typename Po
intT>
73 typedef boost::shared_ptr<SampleConsensusModelSphere>
Ptr;
90 const std::vector<int> &indices,
114 tmp_inliers_ = source.tmp_inliers_;
126 Eigen::VectorXf &model_coefficients);
134 std::vector<double> &distances);
143 const double threshold,
144 std::vector<int> &inliers);
154 const double threshold);
164 const Eigen::VectorXf &model_coefficients,
165 Eigen::VectorXf &optimized_coefficients);
176 const Eigen::VectorXf &model_coefficients,
178 bool copy_data_fields =
true);
187 const Eigen::VectorXf &model_coefficients,
188 const double threshold);
201 if (model_coefficients.size () != 4)
203 PCL_ERROR (
"[pcl::SampleConsensusModelSphere::isModelValid] Invalid number of model coefficients given (%zu)!\n", model_coefficients.size ());
224 const std::vector<int> *tmp_inliers_;
226 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
227 #pragma GCC diagnostic ignored "-Weffc++"
237 pcl::
Functor<float>(m_data_points), model_ (model) {}
245 operator() (
const Eigen::VectorXf &x, Eigen::VectorXf &fvec)
const
247 Eigen::Vector4f cen_t;
249 for (
int i = 0; i < values (); ++i)
252 cen_t[0] = model_->input_->points[(*model_->tmp_inliers_)[i]].x - x[0];
253 cen_t[1] = model_->input_->points[(*model_->tmp_inliers_)[i]].y - x[1];
254 cen_t[2] = model_->input_->points[(*model_->tmp_inliers_)[i]].z - x[2];
257 fvec[i] = sqrtf (cen_t.dot (cen_t)) - x[3];
264 #if defined BUILD_Maintainer && defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ > 3
265 #pragma GCC diagnostic warning "-Weffc++"
270 #ifdef PCL_NO_PRECOMPILE
271 #include <pcl/sample_consensus/impl/sac_model_sphere.hpp>
274 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MODEL_SPHERE_H_