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>;
PointCloud represents the base class in PCL for storing collections of 3D points.
std::uint32_t width
The point cloud width (if organized as an image-structure).
std::uint32_t height
The point cloud height (if organized as an image-structure).
void clear()
Removes all points in a cloud and sets the width and height to 0.
ProjectInliers uses a model and a set of inlier indices from a PointCloud to project them into a sepa...
void applyFilter(PointCloud &output) override
Project point indices into a separate PointCloud.
SampleConsensusModelPlane defines a model for 3D plane segmentation.
@ SACMODEL_PARALLEL_PLANE
@ SACMODEL_NORMAL_PARALLEL_PLANE
@ SACMODEL_PERPENDICULAR_PLANE