145 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_PLANE\n", getClassName ().
c_str ());
151 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_LINE\n", getClassName ().
c_str ());
157 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_STICK\n", getClassName ().
c_str ());
163 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting radius limits to %f/%f\n", getClassName ().
c_str (), radius_min_, radius_max_);
164 model_->setRadiusLimits (radius_min_, radius_max_);
170 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_CIRCLE2D\n", getClassName ().
c_str ());
177 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting radius limits to %f/%f\n", getClassName ().
c_str (), radius_min_, radius_max_);
178 model_circle->setRadiusLimits (radius_min_, radius_max_);
184 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_CIRCLE3D\n", getClassName ().
c_str ());
191 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting radius limits to %f/%f\n", getClassName ().
c_str (), radius_min_, radius_max_);
198 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_SPHERE\n", getClassName ().
c_str ());
205 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting radius limits to %f/%f\n", getClassName ().
c_str (), radius_min_, radius_max_);
206 model_sphere->setRadiusLimits (radius_min_, radius_max_);
212 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_PARALLEL_LINE\n", getClassName ().
c_str ());
215 if (axis_ != Eigen::Vector3f::Zero () &&
model_parallel->getAxis () != axis_)
217 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the axis to %f, %f, %f\n", getClassName ().
c_str (), axis_[0], axis_[1], axis_[2]);
220 if (eps_angle_ != 0.0 &&
model_parallel->getEpsAngle () != eps_angle_)
222 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the epsilon angle to %f (%f degrees)\n", getClassName ().
c_str (), eps_angle_, eps_angle_ * 180.0 /
M_PI);
229 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_PERPENDICULAR_PLANE\n", getClassName ().
c_str ());
234 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the axis to %f, %f, %f\n", getClassName ().
c_str (), axis_[0], axis_[1], axis_[2]);
239 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the epsilon angle to %f (%f degrees)\n", getClassName ().
c_str (), eps_angle_, eps_angle_ * 180.0 /
M_PI);
246 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_PARALLEL_PLANE\n", getClassName ().
c_str ());
249 if (axis_ != Eigen::Vector3f::Zero () &&
model_parallel->getAxis () != axis_)
251 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the axis to %f, %f, %f\n", getClassName ().
c_str (), axis_[0], axis_[1], axis_[2]);
254 if (eps_angle_ != 0.0 &&
model_parallel->getEpsAngle () != eps_angle_)
256 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the epsilon angle to %f (%f degrees)\n", getClassName ().
c_str (), eps_angle_, eps_angle_ * 180.0 /
M_PI);
263 PCL_ERROR (
"[pcl::%s::initSACModel] No valid model given!\n", getClassName ().
c_str ());
282 PCL_DEBUG (
"[pcl::%s::initSAC] Using a method of type: SAC_RANSAC with a model threshold of %f\n", getClassName ().
c_str (), threshold_);
288 PCL_DEBUG (
"[pcl::%s::initSAC] Using a method of type: SAC_LMEDS with a model threshold of %f\n", getClassName ().
c_str (), threshold_);
294 PCL_DEBUG (
"[pcl::%s::initSAC] Using a method of type: SAC_MSAC with a model threshold of %f\n", getClassName ().
c_str (), threshold_);
300 PCL_DEBUG (
"[pcl::%s::initSAC] Using a method of type: SAC_RRANSAC with a model threshold of %f\n", getClassName ().
c_str (), threshold_);
306 PCL_DEBUG (
"[pcl::%s::initSAC] Using a method of type: SAC_RMSAC with a model threshold of %f\n", getClassName ().
c_str (), threshold_);
312 PCL_DEBUG (
"[pcl::%s::initSAC] Using a method of type: SAC_MLESAC with a model threshold of %f\n", getClassName ().
c_str (), threshold_);
318 PCL_DEBUG (
"[pcl::%s::initSAC] Using a method of type: SAC_PROSAC with a model threshold of %f\n", getClassName ().
c_str (), threshold_);
324 if (sac_->getProbability () != probability_)
326 PCL_DEBUG (
"[pcl::%s::initSAC] Setting the desired probability to %f\n", getClassName ().
c_str (), probability_);
327 sac_->setProbability (probability_);
329 if (max_iterations_ != -1 && sac_->getMaxIterations () != max_iterations_)
331 PCL_DEBUG (
"[pcl::%s::initSAC] Setting the maximum number of iterations to %d\n", getClassName ().
c_str (), max_iterations_);
332 sac_->setMaxIterations (max_iterations_);
334 if (samples_radius_ > 0.)
336 PCL_DEBUG (
"[pcl::%s::initSAC] Setting the maximum sample radius to %f\n", getClassName ().
c_str (), samples_radius_);
338 model_->setSamplesMaxDist (samples_radius_, samples_radius_search_);
340 if (sac_->getNumberOfThreads () != threads_)
342 PCL_DEBUG (
"[pcl::%s::initSAC] Setting the number of threads to %i\n", getClassName ().
c_str (), threads_);
343 sac_->setNumberOfThreads (threads_);
351 if (!input_ || !normals_)
353 PCL_ERROR (
"[pcl::%s::initSACModel] Input data (XYZ or normals) not given! Cannot continue.\n", getClassName ().
c_str ());
357 if (input_->size () != normals_->size ())
359 PCL_ERROR (
"[pcl::%s::initSACModel] The number of points in the input point cloud differs than the number of points in the normals!\n", getClassName ().
c_str ());
371 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_CYLINDER\n", getClassName ().
c_str ());
381 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting radius limits to %f/%f\n", getClassName ().
c_str (), radius_min_, radius_max_);
384 if (distance_weight_ !=
model_cylinder->getNormalDistanceWeight ())
386 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting normal distance weight to %f\n", getClassName ().
c_str (), distance_weight_);
389 if (axis_ != Eigen::Vector3f::Zero () &&
model_cylinder->getAxis () != axis_)
391 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the axis to %f, %f, %f\n", getClassName ().
c_str (), axis_[0], axis_[1], axis_[2]);
394 if (eps_angle_ != 0.0 &&
model_cylinder->getEpsAngle () != eps_angle_)
396 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the epsilon angle to %f (%f degrees)\n", getClassName ().
c_str (), eps_angle_, eps_angle_ * 180.0 /
M_PI);
403 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_NORMAL_PLANE\n", getClassName ().
c_str ());
408 if (distance_weight_ !=
model_normals->getNormalDistanceWeight ())
410 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting normal distance weight to %f\n", getClassName ().
c_str (), distance_weight_);
417 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_NORMAL_PARALLEL_PLANE\n", getClassName ().
c_str ());
422 if (distance_weight_ !=
model_normals->getNormalDistanceWeight ())
424 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting normal distance weight to %f\n", getClassName ().
c_str (), distance_weight_);
427 if (distance_from_origin_ !=
model_normals->getDistanceFromOrigin ())
429 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the distance to origin to %f\n", getClassName ().
c_str (), distance_from_origin_);
430 model_normals->setDistanceFromOrigin (distance_from_origin_);
432 if (axis_ != Eigen::Vector3f::Zero () &&
model_normals->getAxis () != axis_)
434 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the axis to %f, %f, %f\n", getClassName ().
c_str (), axis_[0], axis_[1], axis_[2]);
437 if (eps_angle_ != 0.0 &&
model_normals->getEpsAngle () != eps_angle_)
439 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the epsilon angle to %f (%f degrees)\n", getClassName ().
c_str (), eps_angle_, eps_angle_ * 180.0 /
M_PI);
446 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_CONE\n", getClassName ().
c_str ());
456 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting minimum and maximum opening angle to %f and %f \n", getClassName ().
c_str (), min_angle_, max_angle_);
457 model_cone->setMinMaxOpeningAngle (min_angle_, max_angle_);
460 if (distance_weight_ !=
model_cone->getNormalDistanceWeight ())
462 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting normal distance weight to %f\n", getClassName ().
c_str (), distance_weight_);
463 model_cone->setNormalDistanceWeight (distance_weight_);
465 if (axis_ != Eigen::Vector3f::Zero () &&
model_cone->getAxis () != axis_)
467 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the axis to %f, %f, %f\n", getClassName ().
c_str (), axis_[0], axis_[1], axis_[2]);
470 if (eps_angle_ != 0.0 &&
model_cone->getEpsAngle () != eps_angle_)
472 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting the epsilon angle to %f (%f degrees)\n", getClassName ().
c_str (), eps_angle_, eps_angle_ * 180.0 /
M_PI);
479 PCL_DEBUG (
"[pcl::%s::initSACModel] Using a model of type: SACMODEL_NORMAL_SPHERE\n", getClassName ().
c_str ());
488 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting radius limits to %f/%f\n", getClassName ().
c_str (), radius_min_, radius_max_);
494 PCL_DEBUG (
"[pcl::%s::initSACModel] Setting normal distance weight to %f\n", getClassName ().
c_str (), distance_weight_);