43#include <pcl/registration/correspondence_rejection.h>
53template <
typename Po
intT>
64 using Ptr = shared_ptr<CorrespondenceRejectorSampleConsensus<PointT>>;
65 using ConstPtr = shared_ptr<const CorrespondenceRejectorSampleConsensus<PointT>>;
97 inline PointCloudConstPtr
const
113 inline PointCloudConstPtr
const
130 PointCloudPtr cloud(
new PointCloud);
146 PointCloudPtr cloud(
new PointCloud);
192 inline Eigen::Matrix4f
272#include <pcl/registration/impl/correspondence_rejection_sample_consensus.hpp>
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
CorrespondenceRejector()=default
Empty constructor.
CorrespondencesConstPtr input_correspondences_
The input correspondences.
std::string rejection_name_
The name of the rejection method.
const std::string & getClassName() const
Get a string representation of the name of this class.
bool requiresSourcePoints() const override
See if this rejector requires source points.
double getInlierThreshold()
Get the maximum distance between corresponding points.
virtual void setInputSource(const PointCloudConstPtr &cloud)
Provide a source point cloud dataset (must contain XYZ data!).
shared_ptr< const CorrespondenceRejectorSampleConsensus< PointT > > ConstPtr
Eigen::Matrix4f getBestTransformation()
Get the best transformation after RANSAC rejection.
Eigen::Matrix4f best_transformation_
bool getSaveInliers()
Get whether the rejector is configured to save inliers.
virtual void setInputTarget(const PointCloudConstPtr &cloud)
Provide a target point cloud dataset (must contain XYZ data!).
void setInlierThreshold(double threshold)
Set the maximum distance between corresponding points.
pcl::Indices inlier_indices_
void setMaximumIterations(int max_iterations)
Set the maximum number of iterations.
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.
void setTargetPoints(pcl::PCLPointCloud2::ConstPtr cloud2) override
Method for setting the target cloud.
CorrespondencesConstPtr input_correspondences_
The input correspondences.
void setSaveInliers(bool s)
Set whether to save inliers or not.
bool requiresTargetPoints() const override
See if this rejector requires a target cloud.
bool getRefineModel() const
Get the internal refine parameter value as set by the user using setRefineModel.
int getMaximumIterations()
Get the maximum number of iterations.
PointCloudPtr input_transformed_
CorrespondenceRejectorSampleConsensus()
Empty constructor.
~CorrespondenceRejectorSampleConsensus() override=default
Empty destructor.
PointCloudConstPtr const getInputSource()
Get a pointer to the input point cloud dataset target.
std::string rejection_name_
The name of the rejection method.
PointCloudConstPtr const getInputTarget()
Get a pointer to the input point cloud dataset target.
PointCloudConstPtr input_
void applyRejection(pcl::Correspondences &correspondences) override
Apply the rejection algorithm.
void getInliersIndices(pcl::Indices &inlier_indices)
Get the inlier indices found by the correspondence rejector.
void setSourcePoints(pcl::PCLPointCloud2::ConstPtr cloud2) override
Blob method for setting the source cloud.
PointCloudConstPtr target_
void setRefineModel(const bool refine)
Specify whether the model should be refined internally using the variance of the inliers.
shared_ptr< CorrespondenceRejectorSampleConsensus< PointT > > Ptr
#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.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
IndicesAllocator<> Indices
Type used for indices in PCL.
void fromPCLPointCloud2(const pcl::PCLPointCloud2 &msg, pcl::PointCloud< PointT > &cloud, const MsgFieldMap &field_map, const std::uint8_t *msg_data)
Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud<T> object using a field_map.
shared_ptr< const ::pcl::PCLPointCloud2 > ConstPtr