42 #include <pcl/segmentation/planar_region.h>
43 #include <pcl/pcl_base.h>
46 #include <pcl/common/utils.h>
47 #include <pcl/PointIndices.h>
48 #include <pcl/ModelCoefficients.h>
49 #include <pcl/segmentation/plane_coefficient_comparator.h>
50 #include <pcl/segmentation/plane_refinement_comparator.h>
62 template<
typename Po
intT,
typename Po
intNT,
typename Po
intLT>
214 segment (std::vector<ModelCoefficients>& model_coefficients,
215 std::vector<PointIndices>& inlier_indices,
216 std::vector<Eigen::Vector4f, Eigen::aligned_allocator<Eigen::Vector4f> >& centroids,
217 std::vector <Eigen::Matrix3f, Eigen::aligned_allocator<Eigen::Matrix3f> >& covariances,
219 std::vector<pcl::PointIndices>& label_indices);
226 segment (std::vector<ModelCoefficients>& model_coefficients,
227 std::vector<PointIndices>& inlier_indices);
252 std::vector<ModelCoefficients>& model_coefficients,
253 std::vector<PointIndices>& inlier_indices,
255 std::vector<pcl::PointIndices>& label_indices,
256 std::vector<pcl::PointIndices>& boundary_indices);
265 refine (std::vector<ModelCoefficients>& model_coefficients,
266 std::vector<PointIndices>& inlier_indices,
268 std::vector<pcl::PointIndices>& label_indices);
300 return (
"OrganizedMultiPlaneSegmentation");
306 #ifdef PCL_NO_PRECOMPILE
307 #include <pcl/segmentation/impl/organized_multi_plane_segmentation.hpp>
Define standard C methods to do angle calculations.
OrganizedMultiPlaneSegmentation finds all planes present in the input cloud, and outputs a vector of ...
void setInputNormals(const PointCloudNConstPtr &normals)
Provide a pointer to the input normals.
double getDistanceThreshold() const
Get the distance threshold in meters (d component of plane equation) between neighboring points,...
void segment(std::vector< ModelCoefficients > &model_coefficients, std::vector< PointIndices > &inlier_indices, std::vector< Eigen::Vector4f, Eigen::aligned_allocator< Eigen::Vector4f > > ¢roids, std::vector< Eigen::Matrix3f, Eigen::aligned_allocator< Eigen::Matrix3f > > &covariances, pcl::PointCloud< PointLT > &labels, std::vector< pcl::PointIndices > &label_indices)
Segmentation of all planes in a point cloud given by setInputCloud(), setIndices()
void setRefinementComparator(const PlaneRefinementComparatorPtr &compare)
Provide a pointer to the comparator to be used for refinement.
unsigned getMinInliers() const
Get the minimum number of inliers required per plane.
void setDistanceThreshold(double distance_threshold)
Set the tolerance in meters for difference in perpendicular distance (d component of plane equation) ...
bool project_points_
Whether or not points should be projected to the plane, or left in the original 3D space.
PlaneComparatorPtr compare_
A comparator for comparing neighboring pixels' plane equations.
typename PointCloudL::Ptr PointCloudLPtr
double distance_threshold_
The tolerance in meters for difference in perpendicular distance (d component of plane equation) to t...
typename PlaneComparator::Ptr PlaneComparatorPtr
typename PointCloudN::Ptr PointCloudNPtr
unsigned min_inliers_
The minimum number of inliers required for each plane.
void segmentAndRefine(std::vector< PlanarRegion< PointT >, Eigen::aligned_allocator< PlanarRegion< PointT > > > ®ions)
Perform a segmentation, as well as an additional refinement step.
void setComparator(const PlaneComparatorPtr &compare)
Provide a pointer to the comparator to be used for segmentation.
double maximum_curvature_
The tolerance for maximum curvature after fitting a plane.
~OrganizedMultiPlaneSegmentation() override=default
Destructor for OrganizedMultiPlaneSegmentation.
OrganizedMultiPlaneSegmentation()=default
Constructor for OrganizedMultiPlaneSegmentation.
void setMinInliers(unsigned min_inliers)
Set the minimum number of inliers required for a plane.
virtual std::string getClassName() const
Class getName method.
double getMaximumCurvature() const
Get the maximum curvature allowed for a planar region.
typename PlaneRefinementComparator::ConstPtr PlaneRefinementComparatorConstPtr
void setProjectPoints(bool project_points)
Set whether or not to project boundary points to the plane, or leave them in the original 3D space.
typename PlaneComparator::ConstPtr PlaneComparatorConstPtr
double angular_threshold_
The tolerance in radians for difference in normal direction between neighboring points,...
PointCloudNConstPtr getInputNormals() const
Get the input normals.
void setMaximumCurvature(double maximum_curvature)
Set the maximum curvature allowed for a planar region.
typename PointCloudL::ConstPtr PointCloudLConstPtr
void setAngularThreshold(double angular_threshold)
Set the tolerance in radians for difference in normal direction between neighboring points,...
double getAngularThreshold() const
Get the angular threshold in radians for difference in normal direction between neighboring points,...
PointCloudNConstPtr normals_
A pointer to the input normals.
PlaneRefinementComparatorPtr refinement_compare_
A comparator for use on the refinement step.
typename PlaneRefinementComparator::Ptr PlaneRefinementComparatorPtr
typename PointCloudN::ConstPtr PointCloudNConstPtr
void refine(std::vector< ModelCoefficients > &model_coefficients, std::vector< PointIndices > &inlier_indices, PointCloudLPtr &labels, std::vector< pcl::PointIndices > &label_indices)
Perform a refinement of an initial segmentation, by comparing points to adjacent regions detected by ...
typename PointCloud::Ptr PointCloudPtr
typename PointCloud::ConstPtr PointCloudConstPtr
PlanarRegion represents a set of points that lie in a plane.
PlaneCoefficientComparator is a Comparator that operates on plane coefficients, for use in planar seg...
shared_ptr< PlaneCoefficientComparator< PointT, PointNT > > Ptr
shared_ptr< const PlaneCoefficientComparator< PointT, PointNT > > ConstPtr
PlaneRefinementComparator is a Comparator that operates on plane coefficients, for use in planar segm...
shared_ptr< PlaneRefinementComparator< PointT, PointNT, PointLT > > Ptr
shared_ptr< const PlaneRefinementComparator< PointT, PointNT, PointLT > > ConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
float deg2rad(float alpha)
Convert an angle from degrees to radians.
Defines all the PCL and non-PCL macros used.