41 #include <pcl/sample_consensus/sac_model_registration.h>
51 template <
typename Po
intT>
70 using Ptr = shared_ptr<SampleConsensusModelRegistration2D<PointT> >;
71 using ConstPtr = shared_ptr<const SampleConsensusModelRegistration2D<PointT> >;
80 , projection_matrix_ (
Eigen::Matrix3f::Identity ())
98 , projection_matrix_ (
Eigen::Matrix3f::Identity ())
102 model_name_ =
"SampleConsensusModelRegistration2D";
116 std::vector<double> &distances)
const;
125 const double threshold,
136 const double threshold)
const;
143 { projection_matrix_ = projection_matrix; }
146 inline Eigen::Matrix3f
148 {
return (projection_matrix_); }
217 Eigen::Matrix3f projection_matrix_;
224 #include <pcl/sample_consensus/impl/sac_model_registration_2d.hpp>
PointCloud represents the base class in PCL for storing collections of 3D points.
SampleConsensusModel represents the base model class.
shared_ptr< SampleConsensusModel< PointT > > Ptr
unsigned int sample_size_
The size of a sample from which the model is computed.
typename PointCloud::ConstPtr PointCloudConstPtr
std::string model_name_
The model name.
unsigned int model_size_
The number of coefficients in the model.
typename PointCloud::Ptr PointCloudPtr
shared_ptr< const SampleConsensusModel< PointT > > ConstPtr
SampleConsensusModelRegistration2D defines a model for Point-To-Point registration outlier rejection ...
void selectWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold, Indices &inliers)
Select all the points which respect the given model coefficients as inliers.
SampleConsensusModelRegistration2D(const PointCloudConstPtr &cloud, const Indices &indices, bool random=false)
Constructor for base SampleConsensusModelRegistration2D.
void setProjectionMatrix(const Eigen::Matrix3f &projection_matrix)
Set the camera projection matrix.
Eigen::Matrix3f getProjectionMatrix() const
Get the camera projection matrix.
virtual std::size_t countWithinDistance(const Eigen::VectorXf &model_coefficients, const double threshold) const
Count all the points which respect the given model coefficients as inliers.
SampleConsensusModelRegistration2D(const PointCloudConstPtr &cloud, bool random=false)
Constructor for base SampleConsensusModelRegistration2D.
void computeSampleDistanceThreshold(const PointCloudConstPtr &)
Computes an "optimal" sample distance threshold based on the principal directions of the input cloud.
void computeSampleDistanceThreshold(const PointCloudConstPtr &, const Indices &)
Computes an "optimal" sample distance threshold based on the principal directions of the input cloud.
bool isSampleGood(const Indices &samples) const
Check if a sample of indices results in a good sample of points indices.
void getDistancesToModel(const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) const
Compute all distances from the transformed points to their correspondences.
virtual ~SampleConsensusModelRegistration2D()=default
Empty destructor.
SampleConsensusModelRegistration defines a model for Point-To-Point registration outlier rejection.
void setInputCloud(const PointCloudConstPtr &cloud) override
Provide a pointer to the input dataset.
void computeOriginalIndexMapping()
Compute mappings between original indices of the input_/target_ clouds.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Defines functions, macros and traits for allocating and using memory.
IndicesAllocator<> Indices
Type used for indices in PCL.
Defines all the PCL and non-PCL macros used.
A point structure representing Euclidean xyz coordinates, and the RGB color.