Point Cloud Library (PCL)
1.10.1
|
44 #include <pcl/registration/registration.h>
45 #include <pcl/registration/transformation_estimation_svd.h>
54 template <
typename Po
intSource,
typename Po
intTarget,
typename FeatureT>
143 reg_name_ =
"SampleConsensusInitialAlignment";
220 getRandomIndex (
int n) {
return (
static_cast<int> (n * (rand () / (RAND_MAX + 1.0)))); };
231 std::vector<int> &sample_indices);
242 std::vector<int> &corresponding_indices);
282 #include <pcl/registration/impl/ia_ransac.hpp>
typename PointCloudSource::ConstPtr PointCloudSourceConstPtr
typename FeatureCloud::Ptr FeatureCloudPtr
Defines all the PCL and non-PCL macros used.
This file defines compatibility wrappers for low level I/O functions.
int k_correspondences_
The number of neighbors to use when selecting a random feature correspondence.
int nr_samples_
The number of samples to use during each iteration.
Registration represents the base registration class for general purpose, ICP-like methods.
HuberPenalty(float threshold)
const FeatureCloudConstPtr getTargetFeatures()
Get a pointer to the target point cloud's features.
typename PointCloudSource::Ptr PointCloudSourcePtr
shared_ptr< SampleConsensusInitialAlignment< PointSource, PointTarget, FeatureT > > Ptr
SampleConsensusInitialAlignment is an implementation of the initial alignment algorithm described in ...
float operator()(float e) const override
void selectSamples(const PointCloudSource &cloud, int nr_samples, float min_sample_distance, std::vector< int > &sample_indices)
Select nr_samples sample points from cloud while making sure that their pairwise distances are greate...
double corr_dist_threshold_
The maximum distance threshold between two correspondent points in source <-> target.
FeatureCloudConstPtr input_features_
The source point cloud's feature descriptors.
shared_ptr< ErrorFunctor > Ptr
int max_iterations_
The maximum number of iterations the internal optimization should run for.
PointIndices::Ptr PointIndicesPtr
pcl::PointCloud< FeatureT > FeatureCloud
void setMinSampleDistance(float min_sample_distance)
Set the minimum distances between samples.
typename ErrorFunctor::Ptr ErrorFunctorPtr
void setTargetFeatures(const FeatureCloudConstPtr &features)
Provide a shared pointer to the target point cloud's feature descriptors.
ErrorFunctorPtr error_functor_
shared_ptr< const ::pcl::PointIndices > ConstPtr
float min_sample_distance_
The minimum distances between samples.
KdTreeFLANN is a generic type of 3D spatial locator using kD-tree structures.
void setErrorFunction(const ErrorFunctorPtr &error_functor)
Specify the error function to minimize.
virtual ~ErrorFunctor()=default
virtual float operator()(float d) const =0
PointIndices::ConstPtr PointIndicesConstPtr
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
FeatureKdTreePtr feature_tree_
The KdTree used to compare feature descriptors.
void setNumberOfSamples(int nr_samples)
Set the number of samples to use during each iteration.
float getMinSampleDistance()
Get the minimum distances between samples, as set by the user.
float computeErrorMetric(const PointCloudSource &cloud, float threshold)
An error metric for that computes the quality of the alignment between the given cloud and the target...
int getRandomIndex(int n)
Choose a random index between 0 and n-1.
void setCorrespondenceRandomness(int k)
Set the number of neighbors to use when selecting a random feature correspondence.
shared_ptr< ::pcl::PointIndices > Ptr
int getNumberOfSamples()
Get the number of samples to use during each iteration, as set by the user.
typename Registration< PointSource, PointTarget >::PointCloudSource PointCloudSource
shared_ptr< PointCloud< FeatureT > > Ptr
FeatureCloudConstPtr target_features_
The target point cloud's feature descriptors.
TruncatedError(float threshold)
void setSourceFeatures(const FeatureCloudConstPtr &features)
Provide a shared pointer to the source point cloud's feature descriptors.
shared_ptr< const SampleConsensusInitialAlignment< PointSource, PointTarget, FeatureT > > ConstPtr
const FeatureCloudConstPtr getSourceFeatures()
Get a pointer to the source point cloud's features.
virtual float operator()(float e) const
void computeTransformation(PointCloudSource &output, const Eigen::Matrix4f &guess) override
Rigid transformation computation method.
int getCorrespondenceRandomness()
Get the number of neighbors used when selecting a random feature correspondence, as set by the user.
SampleConsensusInitialAlignment()
Constructor.
shared_ptr< const PointCloud< FeatureT > > ConstPtr
ErrorFunctorPtr getErrorFunction()
Get a shared pointer to the ErrorFunctor that is to be minimized
shared_ptr< const ErrorFunctor > ConstPtr
typename Registration< PointSource, PointTarget >::PointCloudTarget PointCloudTarget
TransformationEstimationPtr transformation_estimation_
A TransformationEstimation object, used to calculate the 4x4 rigid transformation.
typename FeatureCloud::ConstPtr FeatureCloudConstPtr
typename KdTreeFLANN< FeatureT >::Ptr FeatureKdTreePtr
std::string reg_name_
The registration method name.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
void findSimilarFeatures(const FeatureCloud &input_features, const std::vector< int > &sample_indices, std::vector< int > &corresponding_indices)
For each of the sample points, find a list of points in the target cloud whose features are similar t...