38 #ifndef PCL_FILTERS_IMPL_PROJECT_INLIERS_H_
39 #define PCL_FILTERS_IMPL_PROJECT_INLIERS_H_
41 #include <pcl/filters/project_inliers.h>
42 #include <pcl/sample_consensus/sac_model_circle.h>
43 #include <pcl/sample_consensus/sac_model_cylinder.h>
44 #include <pcl/sample_consensus/sac_model_cone.h>
45 #include <pcl/sample_consensus/sac_model_line.h>
46 #include <pcl/sample_consensus/sac_model_normal_plane.h>
47 #include <pcl/sample_consensus/sac_model_normal_sphere.h>
48 #include <pcl/sample_consensus/sac_model_parallel_plane.h>
49 #include <pcl/sample_consensus/sac_model_normal_parallel_plane.h>
50 #include <pcl/sample_consensus/sac_model_parallel_line.h>
51 #include <pcl/sample_consensus/sac_model_perpendicular_plane.h>
52 #include <pcl/sample_consensus/sac_model_plane.h>
53 #include <pcl/sample_consensus/sac_model_sphere.h>
56 template <
typename Po
intT>
void
59 if (indices_->empty ())
61 PCL_WARN (
"[pcl::%s::applyFilter] No indices given or empty indices!\n", getClassName ().c_str ());
69 Eigen::VectorXf model_coefficients (model_->values.size ());
70 for (std::size_t i = 0; i < model_->values.size (); ++i)
71 model_coefficients[i] = model_->values[i];
74 if (!initSACModel (model_type_))
76 PCL_ERROR (
"[pcl::%s::applyFilter] Error initializing the SAC model!\n", getClassName ().c_str ());
82 sacmodel_->projectPoints (*indices_, model_coefficients, output,
true);
84 sacmodel_->projectPoints (*indices_, model_coefficients, output,
false);
88 template <
typename Po
intT>
bool
103 sacmodel_.reset (
new SampleConsensusModelLine<PointT> (input_));
109 sacmodel_.reset (
new SampleConsensusModelCircle2D<PointT> (input_));
115 sacmodel_.reset (
new SampleConsensusModelSphere<PointT> (input_));
121 sacmodel_.reset (
new SampleConsensusModelParallelLine<PointT> (input_));
127 sacmodel_.reset (
new SampleConsensusModelPerpendicularPlane<PointT> (input_));
133 sacmodel_.reset (
new SampleConsensusModelCylinder<PointT, pcl::Normal> (input_));
139 sacmodel_.reset (
new SampleConsensusModelNormalPlane<PointT, pcl::Normal> (input_));
145 sacmodel_.reset (
new SampleConsensusModelCone<PointT, pcl::Normal> (input_));
151 sacmodel_.reset (
new SampleConsensusModelNormalSphere<PointT, pcl::Normal> (input_));
157 sacmodel_.reset (
new SampleConsensusModelNormalParallelPlane<PointT, pcl::Normal> (input_));
163 sacmodel_.reset (
new SampleConsensusModelParallelPlane<PointT> (input_));
168 PCL_ERROR (
"[pcl::%s::initSACModel] No valid model given!\n", getClassName ().c_str ());
175 #define PCL_INSTANTIATE_ProjectInliers(T) template class PCL_EXPORTS pcl::ProjectInliers<T>;
177 #endif // PCL_FILTERS_IMPL_PROJECT_INLIERS_H_