Point Cloud Library (PCL)  1.14.1-dev
registration.h
1 #pragma once
2 #include "typedefs.h"
3 
4 #include <pcl/registration/ia_ransac.h>
5 #include <pcl/registration/icp.h>
6 
7 /* Use SampleConsensusInitialAlignment to find a rough alignment from the source cloud to the target cloud by finding
8  * correspondences between two sets of local features
9  * Inputs:
10  * source_points
11  * The "source" points, i.e., the points that must be transformed to align with the target point cloud
12  * source_descriptors
13  * The local descriptors for each source point
14  * target_points
15  * The "target" points, i.e., the points to which the source point cloud will be aligned
16  * target_descriptors
17  * The local descriptors for each target point
18  * min_sample_distance
19  * The minimum distance between any two random samples
20  * max_correspondence_distance
21  * The
22  * nr_iterations
23  * The number of RANSAC iterations to perform
24  * Return: A transformation matrix that will roughly align the points in source to the points in target
25  */
26 Eigen::Matrix4f
27 computeInitialAlignment (const PointCloudPtr & source_points, const LocalDescriptorsPtr & source_descriptors,
28  const PointCloudPtr & target_points, const LocalDescriptorsPtr & target_descriptors,
29  float min_sample_distance, float max_correspondence_distance, int nr_iterations)
30 {
31  return (Eigen::Matrix4f::Identity ());
32 }
33 
34 
35 /* Use IterativeClosestPoint to find a precise alignment from the source cloud to the target cloud,
36  * starting with an initial guess
37  * Inputs:
38  * source_points
39  * The "source" points, i.e., the points that must be transformed to align with the target point cloud
40  * target_points
41  * The "target" points, i.e., the points to which the source point cloud will be aligned
42  * initial_alignment
43  * An initial estimate of the transformation matrix that aligns the source points to the target points
44  * max_correspondence_distance
45  * A threshold on the distance between any two corresponding points. Any corresponding points that are further
46  * apart than this threshold will be ignored when computing the source-to-target transformation
47  * outlier_rejection_threshold
48  * A threshold used to define outliers during RANSAC outlier rejection
49  * transformation_epsilon
50  * The smallest iterative transformation allowed before the algorithm is considered to have converged
51  * max_iterations
52  * The maximum number of ICP iterations to perform
53  * Return: A transformation matrix that will precisely align the points in source to the points in target
54  */
55 Eigen::Matrix4f
56 refineAlignment (const PointCloudPtr & source_points, const PointCloudPtr & target_points,
57  const Eigen::Matrix4f initial_alignment, float max_correspondence_distance,
58  float outlier_rejection_threshold, float transformation_epsilon, float max_iterations)
59 {
60  return (Eigen::Matrix4f::Identity ());
61 }