44 #include <pcl/memory.h>
45 #include <pcl/pcl_macros.h>
46 #include <pcl/registration/correspondence_rejection.h>
48 #include <pcl/sample_consensus/ransac.h>
49 #include <pcl/sample_consensus/sac_model_registration.h>
50 #include <pcl/common/transforms.h>
54 namespace registration
61 template <
typename Po
intT>
73 using Ptr = shared_ptr<CorrespondenceRejectorSampleConsensus<PointT> >;
74 using ConstPtr = shared_ptr<const CorrespondenceRejectorSampleConsensus<PointT> >;
112 inline PointCloudConstPtr
const
122 inline PointCloudConstPtr
const
182 inline Eigen::Matrix4f
249 #include <pcl/registration/impl/correspondence_rejection_sample_consensus.hpp>
void fromPCLPointCloud2(const pcl::PCLPointCloud2 &msg, pcl::PointCloud< PointT > &cloud, const MsgFieldMap &field_map)
Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud object using a field_map...
shared_ptr< const CorrespondenceRejector > ConstPtr
double getInlierThreshold()
Get the maximum distance between corresponding points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< CorrespondenceRejector > Ptr
PointCloudPtr input_transformed_
CorrespondenceRejector represents the base class for correspondence rejection methods ...
shared_ptr< const ::pcl::PCLPointCloud2 > ConstPtr
void setTargetPoints(pcl::PCLPointCloud2::ConstPtr cloud2) override
Method for setting the target cloud.
void getInliersIndices(std::vector< int > &inlier_indices)
Get the inlier indices found by the correspondence rejector.
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
CorrespondenceRejectorSampleConsensus()
Empty constructor.
const std::string & getClassName() const
Get a string representation of the name of this class.
Eigen::Matrix4f getBestTransformation()
Get the best transformation after RANSAC rejection.
PointCloudConstPtr target_
int getMaximumIterations()
Get the maximum number of iterations.
void applyRejection(pcl::Correspondences &correspondences) override
Apply the rejection algorithm.
virtual void setInputTarget(const PointCloudConstPtr &cloud)
Provide a target point cloud dataset (must contain XYZ data!)
void setMaximumIterations(int max_iterations)
Set the maximum number of iterations.
~CorrespondenceRejectorSampleConsensus()
Empty destructor.
PointCloudConstPtr const getInputSource()
Get a pointer to the input point cloud dataset target.
void setInlierThreshold(double threshold)
Set the maximum distance between corresponding points.
Eigen::Matrix4f best_transformation_
PointCloudConstPtr input_
PointCloud represents the base class in PCL for storing collections of 3D points. ...
CorrespondenceRejectorSampleConsensus implements a correspondence rejection using Random Sample Conse...
bool requiresTargetPoints() const override
See if this rejector requires a target cloud.
PointCloudConstPtr const getInputTarget()
Get a pointer to the input point cloud dataset target.
std::vector< int > inlier_indices_
CorrespondencesConstPtr input_correspondences_
The input correspondences.
shared_ptr< const PointCloud< PointT > > ConstPtr
virtual void setInputSource(const PointCloudConstPtr &cloud)
Provide a source point cloud dataset (must contain XYZ data!)
void setSaveInliers(bool s)
Set whether to save inliers or not.
std::string rejection_name_
The name of the rejection method.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
bool requiresSourcePoints() const override
See if this rejector requires source points.
bool getSaveInliers()
Get whether the rejector is configured to save inliers.
void getRemainingCorrespondences(const pcl::Correspondences &original_correspondences, pcl::Correspondences &remaining_correspondences) override
Get a list of valid correspondences after rejection from the original set of correspondences.
bool getRefineModel() const
Get the internal refine parameter value as set by the user using setRefineModel.
void setRefineModel(const bool refine)
Specify whether the model should be refined internally using the variance of the inliers.
void setSourcePoints(pcl::PCLPointCloud2::ConstPtr cloud2) override
Blob method for setting the source cloud.