41 #ifndef PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PERPENDICULAR_PLANE_H_ 42 #define PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PERPENDICULAR_PLANE_H_ 44 #include <pcl/sample_consensus/sac_model_perpendicular_plane.h> 47 template <
typename Po
intT>
void 49 const Eigen::VectorXf &model_coefficients,
const double threshold, std::vector<int> &inliers)
52 if (!isModelValid (model_coefficients))
62 template <
typename Po
intT>
int 64 const Eigen::VectorXf &model_coefficients,
const double threshold)
const 67 if (!isModelValid (model_coefficients))
74 template <
typename Po
intT>
void 76 const Eigen::VectorXf &model_coefficients, std::vector<double> &distances)
const 79 if (!isModelValid (model_coefficients))
89 template <
typename Po
intT>
bool 99 Eigen::Vector4f coeff = model_coefficients;
102 Eigen::Vector4f axis (axis_[0], axis_[1], axis_[2], 0);
103 double angle_diff = fabs (
getAngle3D (axis, coeff));
104 angle_diff = (std::min) (angle_diff, M_PI - angle_diff);
106 if (angle_diff > eps_angle_)
113 #define PCL_INSTANTIATE_SampleConsensusModelPerpendicularPlane(T) template class PCL_EXPORTS pcl::SampleConsensusModelPerpendicularPlane<T>; 115 #endif // PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PERPENDICULAR_PLANE_H_ virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const
Count all the points which respect the given model coefficients as inliers.
double getAngle3D(const Eigen::Vector4f &v1, const Eigen::Vector4f &v2, const bool in_degree=false)
Compute the smallest angle between two 3D vectors in radians (default) or degree. ...
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.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const
Compute all distances from the cloud data to a given plane model.
virtual bool isModelValid(const Eigen::VectorXf &model_coefficients) const
Check whether a model is valid given the user constraints.
SampleConsensusModel represents the base model class.
SampleConsensusModelPlane defines a model for 3D plane segmentation.