ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
GeneralizedICP.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 // @author Ignacio Vizzo [ivizzo@uni-bonn.de]
8 //
9 // Copyright (c) 2021 Ignacio Vizzo, Cyrill Stachniss, University of Bonn.
10 // ----------------------------------------------------------------------------
11 
12 #pragma once
13 
14 #include <Eigen/Core>
15 #include <memory>
16 
17 #include "pipelines/registration/Registration.h"
18 #include "pipelines/registration/RobustKernel.h"
19 #include "pipelines/registration/TransformationEstimation.h"
20 
21 namespace cloudViewer {
22 namespace pipelines {
23 namespace registration {
24 
25 class RegistrationResult;
26 
28  : public TransformationEstimation {
29 public:
31 
33  const override {
34  return type_;
35  };
39  double epsilon = 1e-3,
40  std::shared_ptr<RobustKernel> kernel = std::make_shared<L2Loss>())
41  : epsilon_(epsilon), kernel_(std::move(kernel)) {}
42 
43 public:
44  double ComputeRMSE(const ccPointCloud &source,
45  const ccPointCloud &target,
46  const CorrespondenceSet &corres) const override;
47 
48  Eigen::Matrix4d ComputeTransformation(
49  const ccPointCloud &source,
50  const ccPointCloud &target,
51  const CorrespondenceSet &corres) const override;
52 
53 public:
54  // Small constant representing covariance along the normal.
55  double epsilon_ = 1e-3;
56 
58  std::shared_ptr<RobustKernel> kernel_ = std::make_shared<L2Loss>();
59 
60 private:
61  const TransformationEstimationType type_ =
63 };
64 
68 // A. Segal, D .Haehnel, S. Thrun
78  const ccPointCloud &source,
79  const ccPointCloud &target,
81  const Eigen::Matrix4d &init = Eigen::Matrix4d::Identity(),
85 
86 } // namespace registration
87 } // namespace pipelines
88 } // namespace cloudViewer
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
Class that defines the convergence criteria of ICP.
Definition: Registration.h:36
double ComputeRMSE(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const override
std::shared_ptr< RobustKernel > kernel_
shared_ptr to an Abstract RobustKernel that could mutate at runtime.
TransformationEstimationForGeneralizedICP(double epsilon=1e-3, std::shared_ptr< RobustKernel > kernel=std::make_shared< L2Loss >())
Constructor that takes as input a RobustKernel \params kernel Any of the implemented statistical robu...
TransformationEstimationType GetTransformationEstimationType() const override
Eigen::Matrix4d ComputeTransformation(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const override
RegistrationResult RegistrationGeneralizedICP(const ccPointCloud &source, const ccPointCloud &target, double max_correspondence_distance, const Eigen::Matrix4d &init, const TransformationEstimationForGeneralizedICP &estimation, const ICPConvergenceCriteria &criteria)
Function for Generalized ICP registration.
std::vector< Eigen::Vector2i > CorrespondenceSet
static const double max_correspondence_distance
Generic file read and write utility for python interface.
Definition: Eigen.h:85