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