41 #ifndef PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PARALLEL_LINE_H_
42 #define PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PARALLEL_LINE_H_
44 #include <pcl/sample_consensus/sac_model_parallel_line.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)
67 if (!isModelValid (model_coefficients))
74 template <
typename Po
intT>
void
76 const Eigen::VectorXf &model_coefficients, std::vector<double> &distances)
79 if (!isModelValid (model_coefficients))
89 template <
typename Po
intT>
bool
93 if (model_coefficients.size () != 6)
95 PCL_ERROR (
"[pcl::SampleConsensusParallelLine::isModelValid] Invalid number of model coefficients given (%zu)!\n", model_coefficients.size ());
100 if (eps_angle_ > 0.0)
103 Eigen::Vector4f line_dir (model_coefficients[3], model_coefficients[4], model_coefficients[5], 0);
105 Eigen::Vector4f axis (axis_[0], axis_[1], axis_[2], 0);
106 double angle_diff = fabs (
getAngle3D (axis, line_dir));
108 angle_diff = fabs (angle_diff - (M_PI/2.0));
110 if (angle_diff > eps_angle_)
117 #define PCL_INSTANTIATE_SampleConsensusModelParallelLine(T) template class PCL_EXPORTS pcl::SampleConsensusModelParallelLine<T>;
119 #endif // PCL_SAMPLE_CONSENSUS_IMPL_SAC_MODEL_PARALLEL_LINE_H_
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.
bool isModelValid(const Eigen::VectorXf &model_coefficients)
Check whether a model is valid given the user constraints.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances)
Compute all squared distances from the cloud data to a given line model.
SampleConsensusModelLine defines a model for 3D line segmentation.
virtual int countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold)
Count all the points which respect the given model coefficients as inliers.
double getAngle3D(const Eigen::Vector4f &v1, const Eigen::Vector4f &v2)
Compute the smallest angle between two vectors in the [ 0, PI ) interval in 3D.