RTAB-Map 0.23.10
Loading...
Searching...
No Matches
util3d_registration.h
1/*
2Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are met:
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9 * Redistributions in binary form must reproduce the above copyright
10 notice, this list of conditions and the following disclaimer in the
11 documentation and/or other materials provided with the distribution.
12 * Neither the name of the Universite de Sherbrooke nor the
13 names of its contributors may be used to endorse or promote products
14 derived from this software without specific prior written permission.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*/
27
28#ifndef UTIL3D_REGISTRATION_H_
29#define UTIL3D_REGISTRATION_H_
30
31#include <rtabmap/core/rtabmap_core_export.h>
32
33#include <pcl/point_cloud.h>
34#include <pcl/point_types.h>
35#include <rtabmap/core/Transform.h>
36#include <opencv2/core/core.hpp>
37
38namespace rtabmap
39{
40
41namespace util3d
42{
43
44int RTABMAP_CORE_EXPORT getCorrespondencesCount(const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud_source,
45 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud_target,
46 float maxDistance);
47
68Transform RTABMAP_CORE_EXPORT transformFromXYZCorrespondencesSVD(
69 const pcl::PointCloud<pcl::PointXYZ> & cloud1,
70 const pcl::PointCloud<pcl::PointXYZ> & cloud2);
71
101Transform RTABMAP_CORE_EXPORT transformFromXYZCorrespondences(
102 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud1,
103 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud2,
104 double inlierThreshold = 0.02,
105 int iterations = 100,
106 int refineModelIterations = 10,
107 double refineModelSigma = 3.0,
108 std::vector<int> * inliers = 0,
109 cv::Mat * variance = 0);
110
141void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
142 const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloudA,
143 const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloudB,
144 double maxCorrespondenceDistance,
145 double maxCorrespondenceAngle, // <=0 means that we don't care about normal angle difference
146 double & variance,
147 int & correspondencesOut,
148 bool reciprocal);
153void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
154 const pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr & cloudA,
155 const pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr & cloudB,
156 double maxCorrespondenceDistance,
157 double maxCorrespondenceAngle, // <=0 means that we don't care about normal angle difference
158 double & variance,
159 int & correspondencesOut,
160 bool reciprocal);
165void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
166 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloudA,
167 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloudB,
168 double maxCorrespondenceDistance,
169 double & variance,
170 int & correspondencesOut,
171 bool reciprocal);
176void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(
177 const pcl::PointCloud<pcl::PointXYZI>::ConstPtr & cloudA,
178 const pcl::PointCloud<pcl::PointXYZI>::ConstPtr & cloudB,
179 double maxCorrespondenceDistance,
180 double & variance,
181 int & correspondencesOut,
182 bool reciprocal);
183
209Transform RTABMAP_CORE_EXPORT icp(
210 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud_source,
211 const pcl::PointCloud<pcl::PointXYZ>::ConstPtr & cloud_target,
212 double maxCorrespondenceDistance,
213 int maximumIterations,
214 bool & hasConverged,
215 pcl::PointCloud<pcl::PointXYZ> & cloud_source_registered,
216 float epsilon = 0.0f,
217 bool icp2D = false,
218 float ransacOutlierRatio = 0.0f,
219 int * iterationsDone = nullptr);
228Transform RTABMAP_CORE_EXPORT icp(
229 const pcl::PointCloud<pcl::PointXYZI>::ConstPtr & cloud_source,
230 const pcl::PointCloud<pcl::PointXYZI>::ConstPtr & cloud_target,
231 double maxCorrespondenceDistance,
232 int maximumIterations,
233 bool & hasConverged,
234 pcl::PointCloud<pcl::PointXYZI> & cloud_source_registered,
235 float epsilon = 0.0f,
236 bool icp2D = false,
237 float ransacOutlierRatio = 0.0f,
238 int * iterationsDone = nullptr);
239
265Transform RTABMAP_CORE_EXPORT icpPointToPlane(
266 const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloud_source,
267 const pcl::PointCloud<pcl::PointNormal>::ConstPtr & cloud_target,
268 double maxCorrespondenceDistance,
269 int maximumIterations,
270 bool & hasConverged,
271 pcl::PointCloud<pcl::PointNormal> & cloud_source_registered,
272 float epsilon = 0.0f,
273 bool icp2D = false,
274 float ransacOutlierRatio = 0.0f,
275 int * iterationsDone = nullptr);
284Transform RTABMAP_CORE_EXPORT icpPointToPlane(
285 const pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr & cloud_source,
286 const pcl::PointCloud<pcl::PointXYZINormal>::ConstPtr & cloud_target,
287 double maxCorrespondenceDistance,
288 int maximumIterations,
289 bool & hasConverged,
290 pcl::PointCloud<pcl::PointXYZINormal> & cloud_source_registered,
291 float epsilon = 0.0f,
292 bool icp2D = false,
293 float ransacOutlierRatio = 0.0f,
294 int * iterationsDone = nullptr);
295
296} // namespace util3d
297} // namespace rtabmap
298
299#endif /* UTIL3D_REGISTRATION_H_ */
Represents a 3D rigid body transformation (rotation + translation).
Definition Transform.h:53
void RTABMAP_CORE_EXPORT computeVarianceAndCorrespondences(const pcl::PointCloud< pcl::PointNormal >::ConstPtr &cloudA, const pcl::PointCloud< pcl::PointNormal >::ConstPtr &cloudB, double maxCorrespondenceDistance, double maxCorrespondenceAngle, double &variance, int &correspondencesOut, bool reciprocal)
Compute with variance and correspondences of pcl::PointNormal point cloud type.