41 #ifndef PCL_SAMPLE_CONSENSUS_MODEL_NORMALPARALLELPLANE_H_
42 #define PCL_SAMPLE_CONSENSUS_MODEL_NORMALPARALLELPLANE_H_
44 #include <pcl/sample_consensus/sac_model.h>
45 #include <pcl/sample_consensus/sac_model_plane.h>
46 #include <pcl/sample_consensus/sac_model_perpendicular_plane.h>
47 #include <pcl/sample_consensus/model_types.h>
85 template <
typename Po
intT,
typename Po
intNT>
102 typedef boost::shared_ptr<SampleConsensusModelNormalParallelPlane>
Ptr;
112 , axis_ (Eigen::Vector4f::Zero ())
113 , distance_from_origin_ (0)
126 const std::vector<int> &indices,
130 , axis_ (Eigen::Vector4f::Zero ())
131 , distance_from_origin_ (0)
145 setAxis (
const Eigen::Vector3f &ax) { axis_.head<3> () = ax; axis_.normalize ();}
148 inline Eigen::Vector3f
156 setEpsAngle (
const double ea) { eps_angle_ = ea; cos_angle_ = fabs (cos (ea));}
189 const double threshold,
190 std::vector<int> &inliers);
200 const double threshold);
208 std::vector<double> &distances);
214 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
221 isModelValid (
const Eigen::VectorXf &model_coefficients);
225 Eigen::Vector4f axis_;
228 double distance_from_origin_;
240 #ifdef PCL_NO_PRECOMPILE
241 #include <pcl/sample_consensus/impl/sac_model_normal_parallel_plane.hpp>
244 #endif //#ifndef PCL_SAMPLE_CONSENSUS_MODEL_NORMALPARALLELPLANE_H_
SampleConsensusModelNormalParallelPlane(const PointCloudConstPtr &cloud, const std::vector< int > &indices, bool random=false)
Constructor for base SampleConsensusModelNormalParallelPlane.
virtual ~SampleConsensusModelNormalParallelPlane()
Empty destructor.
pcl::PointCloud< PointT >::Ptr PointCloudPtr
void setAxis(const Eigen::Vector3f &ax)
Set the axis along which we need to search for a plane perpendicular to.
double getEpsAngle()
Get the angle epsilon (delta) threshold.
SampleConsensusModel< PointT >::PointCloud PointCloud
pcl::PointCloud< PointNT >::Ptr PointCloudNPtr
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold)
Count all the points which respect the given model coefficients as inliers.
pcl::PointCloud< PointNT >::ConstPtr PointCloudNConstPtr
SampleConsensusModelFromNormals represents the base model class for models that require the use of su...
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances)
Compute all distances from the cloud data to a given plane model.
SampleConsensusModel< PointT >::PointCloudConstPtr PointCloudConstPtr
SampleConsensusModelPlane defines a model for 3D plane segmentation.
SampleConsensusModelNormalParallelPlane(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelNormalParallelPlane.
double getEpsDist()
Get the distance epsilon (delta) threshold.
SampleConsensusModelNormalParallelPlane defines a model for 3D plane segmentation using additional su...
bool isModelValid(const Eigen::VectorXf &model_coefficients)
Check whether a model is valid given the user constraints.
void setEpsAngle(const double ea)
Set the angle epsilon (delta) threshold.
SampleConsensusModelFromNormals< PointT, PointNT >::PointCloudNPtr PointCloudNPtr
SampleConsensusModel represents the base model class.
pcl::SacModel getModelType() const
Return an unique id for this model (SACMODEL_NORMAL_PARALLEL_PLANE).
SampleConsensusModel< PointT >::PointCloudPtr PointCloudPtr
Eigen::Vector3f getAxis()
Get the axis along which we need to search for a plane perpendicular to.
SampleConsensusModelFromNormals< PointT, PointNT >::PointCloudNConstPtr PointCloudNConstPtr
A point structure representing Euclidean xyz coordinates, and the RGB color.
void setDistanceFromOrigin(const double d)
Set the distance we expect the plane to be from the origin.
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, std::vector< int > &inliers)
Select all the points which respect the given model coefficients as inliers.
boost::shared_ptr< SampleConsensusModelNormalParallelPlane > Ptr
pcl::PointCloud< PointT >::ConstPtr PointCloudConstPtr
void setEpsDist(const double delta)
Set the distance epsilon (delta) threshold.
double getDistanceFromOrigin()
Get the distance of the plane from the origin.