41 #ifndef PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PARALLEL_LINE_HPP_ 42 #define PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PARALLEL_LINE_HPP_ 45 #include <pcl/sample_consensus/sac_model_parallel_line.h> 48 template <
typename Po
intT>
void 50 const Eigen::VectorXf &model_coefficients,
const double threshold, std::vector<int> &inliers)
53 if (!isModelValid (model_coefficients))
63 template <
typename Po
intT>
int 65 const Eigen::VectorXf &model_coefficients,
const double threshold)
const 68 if (!isModelValid (model_coefficients))
75 template <
typename Po
intT>
void 77 const Eigen::VectorXf &model_coefficients, std::vector<double> &distances)
const 80 if (!isModelValid (model_coefficients))
90 template <
typename Po
intT>
bool 100 Eigen::Vector4f line_dir (model_coefficients[3], model_coefficients[4], model_coefficients[5], 0);
102 Eigen::Vector4f axis (axis_[0], axis_[1], axis_[2], 0);
103 double angle_diff = fabs (
getAngle3D (axis, line_dir));
104 angle_diff = (std::min) (angle_diff, M_PI - angle_diff);
106 if (angle_diff > eps_angle_)
113 #define PCL_INSTANTIATE_SampleConsensusModelParallelLine(T) template class PCL_EXPORTS pcl::SampleConsensusModelParallelLine<T>; 115 #endif // PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PARALLEL_LINE_HPP_ 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.
SampleConsensusModelLine defines a model for 3D line segmentation.
virtual bool isModelValid(const Eigen::VectorXf &model_coefficients) const
Check whether a model is valid given the user constraints.
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.
Define standard C methods and C++ classes that are common to all methods.
SampleConsensusModel represents the base model class.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const
Compute all squared distances from the cloud data to a given line model.
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const
Count all the points which respect the given model coefficients as inliers.