40 #ifndef PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SAMPLE_CONSENSUS_H_ 41 #define PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SAMPLE_CONSENSUS_H_ 43 #include <pcl/registration/correspondence_rejection.h> 45 #include <pcl/sample_consensus/ransac.h> 46 #include <pcl/sample_consensus/sac_model_registration.h> 47 #include <pcl/common/transforms.h> 51 namespace registration
58 template <
typename Po
intT>
70 typedef boost::shared_ptr<CorrespondenceRejectorSampleConsensus>
Ptr;
71 typedef boost::shared_ptr<const CorrespondenceRejectorSampleConsensus>
ConstPtr;
103 PCL_DEPRECATED (
"[pcl::registration::CorrespondenceRejectorSampleConsensus::setInputCloud] setInputCloud is deprecated. Please use setInputSource instead.")
108 PCL_DEPRECATED (
"[pcl::registration::CorrespondenceRejectorSampleConsensus::getInputCloud] getInputCloud is deprecated. Please use getInputSource instead.")
109 PointCloudConstPtr
const 122 inline PointCloudConstPtr
const 128 PCL_DEPRECATED (
"[pcl::registration::CorrespondenceRejectorSampleConsensus::setTargetCloud] setTargetCloud is deprecated. Please use setInputTarget instead.")
139 inline PointCloudConstPtr
const 152 PointCloudPtr cloud (
new PointCloud);
166 PointCloudPtr cloud (
new PointCloud);
187 PCL_DEPRECATED (
"[pcl::registration::CorrespondenceRejectorSampleConsensus::setMaxIterations] setMaxIterations is deprecated. Please use setMaximumIterations instead.")
200 PCL_DEPRECATED (
"[pcl::registration::CorrespondenceRejectorSampleConsensus::getMaxIterations] getMaxIterations is deprecated. Please use getMaximumIterations instead.")
213 inline Eigen::Matrix4f
275 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
280 #include <pcl/registration/impl/correspondence_rejection_sample_consensus.hpp> 282 #endif // PCL_REGISTRATION_CORRESPONDENCE_REJECTION_SAMPLE_CONSENSUS_H_ void fromPCLPointCloud2(const pcl::PCLPointCloud2 &msg, pcl::PointCloud< PointT > &cloud, const MsgFieldMap &field_map)
Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud<T> object using a field_map...
double getInlierThreshold()
Get the maximum distance between corresponding points.
bool requiresSourcePoints() const
See if this rejector requires source points.
virtual void setTargetCloud(const PointCloudConstPtr &cloud)
Provide a target point cloud dataset (must contain XYZ data!)
PointCloudPtr input_transformed_
CorrespondenceRejector represents the base class for correspondence rejection methods ...
virtual ~CorrespondenceRejectorSampleConsensus()
Empty destructor.
void getInliersIndices(std::vector< int > &inlier_indices)
Get the inlier indices found by the correspondence rejector.
PointCloudConstPtr const getInputCloud()
Get a pointer to the input point cloud dataset target.
void setMaxIterations(int max_iterations)
Set the maximum number of iterations.
int getMaxIterations()
Get the maximum number of iterations.
void setTargetPoints(pcl::PCLPointCloud2::ConstPtr cloud2)
Method for setting the target cloud.
CorrespondenceRejectorSampleConsensus()
Empty constructor.
boost::shared_ptr< PointCloud< PointT > > Ptr
const std::string & getClassName() const
Get a string representation of the name of this class.
boost::shared_ptr< CorrespondenceRejectorSampleConsensus > Ptr
Eigen::Matrix4f getBestTransformation()
Get the best transformation after RANSAC rejection.
PointCloudConstPtr target_
int getMaximumIterations()
Get the maximum number of iterations.
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.
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
PointCloudConstPtr const getInputSource()
Get a pointer to the input point cloud dataset target.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
void setInlierThreshold(double threshold)
Set the maximum distance between corresponding points.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
Eigen::Matrix4f best_transformation_
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Provide a source point cloud dataset (must contain XYZ data!)
void setSourcePoints(pcl::PCLPointCloud2::ConstPtr cloud2)
Blob method for setting the source cloud.
bool requiresTargetPoints() const
See if this rejector requires a target cloud.
PointCloudConstPtr input_
PointCloud represents the base class in PCL for storing collections of 3D points. ...
CorrespondenceRejectorSampleConsensus implements a correspondence rejection using Random Sample Conse...
PointCloudConstPtr const getInputTarget()
Get a pointer to the input point cloud dataset target.
std::vector< int > inlier_indices_
void applyRejection(pcl::Correspondences &correspondences)
Apply the rejection algorithm.
CorrespondencesConstPtr input_correspondences_
The input correspondences.
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.
bool getSaveInliers()
Get whether the rejector is configured to save inliers.
boost::shared_ptr< const CorrespondenceRejectorSampleConsensus > ConstPtr
void getRemainingCorrespondences(const pcl::Correspondences &original_correspondences, pcl::Correspondences &remaining_correspondences)
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.