49#include <pcl/registration/transformation_estimation_svd.h>
50#include <pcl/kdtree/kdtree_flann.h>
51#include <pcl/correspondence.h>
52#include <pcl/point_cloud.h>
53#include <pcl/pcl_exports.h>
55#include <pcl/recognition/ransac_based/auxiliary.h>
61 template<
typename Po
intT,
typename Scalar>
68 using Matrix4 =
typename Eigen::Matrix<Scalar, 4, 4>;
72 : new_to_old_energy_ratio_ (0.99f)
87 kdtree_.setInputCloud (
target);
105 printf (
"WARNING in 'TrimmedICP::%s()': the user-defined number of source points of interest is greater or equal to "
106 "the total number of source points. Trimmed ICP will work correctly but won't be very efficient. Either set "
107 "the number of source points to use to a lower value or use standard ICP.\n",
__func__);
166 new_to_old_energy_ratio_ = 0.99f;
168 new_to_old_energy_ratio_ =
ratio;
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
shared_ptr< const PointCloud< PointT > > ConstPtr
float new_to_old_energy_ratio_
pcl::KdTreeFLANN< PointT > kdtree_
PointCloudConstPtr target_points_
typename PointCloud::ConstPtr PointCloudConstPtr
void init(const PointCloudConstPtr &target)
Call this method before calling align().
static bool compareCorrespondences(const pcl::Correspondence &a, const pcl::Correspondence &b)
typename Eigen::Matrix< Scalar, 4, 4 > Matrix4
void setNewToOldEnergyRatio(float ratio)
void align(const PointCloud &source_points, int num_source_points_to_use, Matrix4 &guess_and_result) const
The method performs trimmed ICP, i.e., it rigidly registers the source to the target (passed to the i...
std::vector< pcl::Correspondence, Eigen::aligned_allocator< pcl::Correspondence > > Correspondences
Correspondence represents a match between two entities (e.g., points, descriptors,...
A point structure representing Euclidean xyz coordinates.