SampleConsensusModelRegistration defines a model for Point-To-Point registration outlier rejection. More...
#include <sac_model_registration.h>
Public Types | |
typedef SampleConsensusModel < PointT >::PointCloud | PointCloud |
typedef SampleConsensusModel < PointT >::PointCloudConstPtr | PointCloudConstPtr |
typedef SampleConsensusModel < PointT >::PointCloudPtr | PointCloudPtr |
typedef boost::shared_ptr < SampleConsensusModelRegistration > | Ptr |
Public Member Functions | |
bool | computeModelCoefficients (const std::vector< int > &samples, Eigen::VectorXf &model_coefficients) |
Compute a 4x4 rigid transformation matrix from the samples given. | |
void | computeSampleDistanceThreshold (const PointCloudConstPtr &cloud) |
Computes an "optimal" sample distance threshold based on the principal directions of the input cloud. | |
bool | doSamplesVerifyModel (const std::set< int > &indices, const Eigen::VectorXf &model_coefficients, double threshold) |
Verify whether a subset of indices verifies a given set of model coefficients. Pure virtual. | |
void | getDistancesToModel (const Eigen::VectorXf &model_coefficients, std::vector< double > &distances) |
Compute all distances from the transformed points to their correspondences. | |
pcl::SacModel | getModelType () const |
Return an unique id for this model (SACMODEL_REGISTRATION). | |
void | getSamples (int &iterations, std::vector< int > &samples) |
Get 3 random indices from a subset of given indices. | |
void | optimizeModelCoefficients (const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, Eigen::VectorXf &optimized_coefficients) |
Recompute the 4x4 transformation using the given inlier set. | |
void | projectPoints (const std::vector< int > &inliers, const Eigen::VectorXf &model_coefficients, PointCloud &projected_points, bool copy_data_fields=true) |
Create a new point cloud with inliers projected onto the model. Pure virtual. | |
SampleConsensusModelRegistration (const PointCloudConstPtr &cloud, const std::vector< int > &indices) | |
Constructor for base SampleConsensusModelRegistration. | |
SampleConsensusModelRegistration (const PointCloudConstPtr &cloud) | |
Constructor for base SampleConsensusModelRegistration. | |
void | selectWithinDistance (const Eigen::VectorXf &model_coefficients, double threshold, std::vector< int > &inliers) |
Select all the points which respect the given model coefficients as inliers. | |
virtual void | setInputCloud (const PointCloudConstPtr &cloud) |
Provide a pointer to the input dataset. | |
void | setInputTarget (const PointCloudConstPtr &target, const std::vector< int > &indices_tgt) |
Set the input point cloud target. | |
void | setInputTarget (const PointCloudConstPtr &target) |
Set the input point cloud target. | |
Protected Member Functions | |
bool | isModelValid (const Eigen::VectorXf &model_coefficients) |
Check whether a model is valid given the user constraints. | |
Private Attributes | |
IndicesPtr | indices_tgt_ |
A pointer to the vector of target point indices to use. | |
double | sample_dist_thresh_ |
Internal distance threshold used for the sample selection step. | |
PointCloudConstPtr | target_ |
A boost shared pointer to the target point cloud data array. | |
Static Private Attributes | |
static const int | MAX_ITERATIONS_COLLINEAR = 1000 |
Define the maximum number of iterations for collinearity checks. |
SampleConsensusModelRegistration defines a model for Point-To-Point registration outlier rejection.
Definition at line 52 of file sac_model_registration.h.
typedef SampleConsensusModel<PointT>::PointCloud pcl::SampleConsensusModelRegistration< PointT >::PointCloud |
Reimplemented from pcl::SampleConsensusModel< PointT >.
Definition at line 58 of file sac_model_registration.h.
typedef SampleConsensusModel<PointT>::PointCloudConstPtr pcl::SampleConsensusModelRegistration< PointT >::PointCloudConstPtr |
Reimplemented from pcl::SampleConsensusModel< PointT >.
Definition at line 60 of file sac_model_registration.h.
typedef SampleConsensusModel<PointT>::PointCloudPtr pcl::SampleConsensusModelRegistration< PointT >::PointCloudPtr |
Reimplemented from pcl::SampleConsensusModel< PointT >.
Definition at line 59 of file sac_model_registration.h.
typedef boost::shared_ptr<SampleConsensusModelRegistration> pcl::SampleConsensusModelRegistration< PointT >::Ptr |
Reimplemented from pcl::SampleConsensusModel< PointT >.
Definition at line 62 of file sac_model_registration.h.
pcl::SampleConsensusModelRegistration< PointT >::SampleConsensusModelRegistration | ( | const PointCloudConstPtr & | cloud | ) | [inline] |
Constructor for base SampleConsensusModelRegistration.
cloud | the input point cloud dataset |
Definition at line 67 of file sac_model_registration.h.
pcl::SampleConsensusModelRegistration< PointT >::SampleConsensusModelRegistration | ( | const PointCloudConstPtr & | cloud, | |
const std::vector< int > & | indices | |||
) | [inline] |
Constructor for base SampleConsensusModelRegistration.
cloud | the input point cloud dataset | |
indices | a vector of point indices to be used from cloud |
Definition at line 76 of file sac_model_registration.h.
bool pcl::SampleConsensusModelRegistration< PointT >::computeModelCoefficients | ( | const std::vector< int > & | samples, | |
Eigen::VectorXf & | model_coefficients | |||
) | [inline, virtual] |
Compute a 4x4 rigid transformation matrix from the samples given.
samples | the indices found as good candidates for creating a valid model | |
model_coefficients | the resultant model coefficients |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 151 of file sac_model_registration.hpp.
void pcl::SampleConsensusModelRegistration< PointT >::computeSampleDistanceThreshold | ( | const PointCloudConstPtr & | cloud | ) | [inline] |
Computes an "optimal" sample distance threshold based on the principal directions of the input cloud.
cloud | the const boost shared pointer to a PointCloud message |
Definition at line 99 of file sac_model_registration.h.
bool pcl::SampleConsensusModelRegistration< PointT >::doSamplesVerifyModel | ( | const std::set< int > & | indices, | |
const Eigen::VectorXf & | model_coefficients, | |||
double | threshold | |||
) | [inline, virtual] |
Verify whether a subset of indices verifies a given set of model coefficients. Pure virtual.
indices | the data indices that need to be tested against the model | |
model_coefficients | the set of model coefficients | |
threshold | a maximum admissible distance threshold for determining the inliers from the outliers |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 192 of file sac_model_registration.h.
void pcl::SampleConsensusModelRegistration< PointT >::getDistancesToModel | ( | const Eigen::VectorXf & | model_coefficients, | |
std::vector< double > & | distances | |||
) | [inline, virtual] |
Compute all distances from the transformed points to their correspondences.
model_coefficients | the 4x4 transformation matrix | |
distances | the resultant estimated distances |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 178 of file sac_model_registration.hpp.
pcl::SacModel pcl::SampleConsensusModelRegistration< PointT >::getModelType | ( | ) | const [inline, virtual] |
Return an unique id for this model (SACMODEL_REGISTRATION).
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 199 of file sac_model_registration.h.
void pcl::SampleConsensusModelRegistration< PointT >::getSamples | ( | int & | iterations, | |
std::vector< int > & | samples | |||
) | [inline, virtual] |
Get 3 random indices from a subset of given indices.
iterations | the internal number of iterations used by SAC methods | |
samples | the resultant model samples |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 48 of file sac_model_registration.hpp.
bool pcl::SampleConsensusModelRegistration< PointT >::isModelValid | ( | const Eigen::VectorXf & | model_coefficients | ) | [inline, protected, virtual] |
Check whether a model is valid given the user constraints.
model_coefficients | the set of model coefficients |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 206 of file sac_model_registration.h.
void pcl::SampleConsensusModelRegistration< PointT >::optimizeModelCoefficients | ( | const std::vector< int > & | inliers, | |
const Eigen::VectorXf & | model_coefficients, | |||
Eigen::VectorXf & | optimized_coefficients | |||
) | [inline, virtual] |
Recompute the 4x4 transformation using the given inlier set.
inliers | the data inliers found as supporting the model | |
model_coefficients | the initial guess for the optimization | |
optimized_coefficients | the resultant recomputed transformation |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 255 of file sac_model_registration.hpp.
void pcl::SampleConsensusModelRegistration< PointT >::projectPoints | ( | const std::vector< int > & | inliers, | |
const Eigen::VectorXf & | model_coefficients, | |||
PointCloud & | projected_points, | |||
bool | copy_data_fields = true | |||
) | [inline, virtual] |
Create a new point cloud with inliers projected onto the model. Pure virtual.
inliers | the data inliers that we want to project on the model | |
model_coefficients | the coefficients of a model | |
projected_points | the resultant projected points | |
copy_data_fields | set to true (default) if we want the projected_points cloud to be an exact copy of the input dataset minus the point projections on the plane model |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 186 of file sac_model_registration.h.
void pcl::SampleConsensusModelRegistration< PointT >::selectWithinDistance | ( | const Eigen::VectorXf & | model_coefficients, | |
double | threshold, | |||
std::vector< int > & | inliers | |||
) | [inline, virtual] |
Select all the points which respect the given model coefficients as inliers.
model_coefficients | the 4x4 transformation matrix | |
threshold | a maximum admissible distance threshold for determining the inliers from the outliers | |
inliers | the resultant model inliers |
Implements pcl::SampleConsensusModel< PointT >.
Definition at line 214 of file sac_model_registration.hpp.
virtual void pcl::SampleConsensusModelRegistration< PointT >::setInputCloud | ( | const PointCloudConstPtr & | cloud | ) | [inline, virtual] |
Provide a pointer to the input dataset.
cloud | the const boost shared pointer to a PointCloud message |
Reimplemented from pcl::SampleConsensusModel< PointT >.
Definition at line 88 of file sac_model_registration.h.
void pcl::SampleConsensusModelRegistration< PointT >::setInputTarget | ( | const PointCloudConstPtr & | target, | |
const std::vector< int > & | indices_tgt | |||
) | [inline] |
Set the input point cloud target.
target | the input point cloud target | |
indices_tgt | a vector of point indices to be used from target |
Definition at line 135 of file sac_model_registration.h.
void pcl::SampleConsensusModelRegistration< PointT >::setInputTarget | ( | const PointCloudConstPtr & | target | ) | [inline] |
Set the input point cloud target.
target | the input point cloud target |
Definition at line 120 of file sac_model_registration.h.
IndicesPtr pcl::SampleConsensusModelRegistration< PointT >::indices_tgt_ [private] |
A pointer to the vector of target point indices to use.
Definition at line 220 of file sac_model_registration.h.
const int pcl::SampleConsensusModelRegistration< PointT >::MAX_ITERATIONS_COLLINEAR = 1000 [static, private] |
Define the maximum number of iterations for collinearity checks.
Definition at line 226 of file sac_model_registration.h.
double pcl::SampleConsensusModelRegistration< PointT >::sample_dist_thresh_ [private] |
Internal distance threshold used for the sample selection step.
Definition at line 223 of file sac_model_registration.h.
PointCloudConstPtr pcl::SampleConsensusModelRegistration< PointT >::target_ [private] |
A boost shared pointer to the target point cloud data array.
Definition at line 217 of file sac_model_registration.h.