ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
TransformationEstimation.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 
8 #pragma once
9 
10 #include <Eigen.h>
11 
12 #include <string>
13 #include <utility>
14 
15 #include "pipelines/registration/RobustKernel.h"
16 
17 class ccPointCloud;
18 namespace cloudViewer {
19 
20 namespace pipelines {
21 namespace registration {
22 
23 typedef std::vector<Eigen::Vector2i> CorrespondenceSet;
24 
26  Unspecified = 0,
27  PointToPoint = 1,
28  PointToPlane = 2,
29  ColoredICP = 3,
30  GeneralizedICP = 4,
31 };
32 
39 public:
43 
44 public:
46  const = 0;
53  virtual double ComputeRMSE(const ccPointCloud &source,
54  const ccPointCloud &target,
55  const CorrespondenceSet &corres) const = 0;
62  virtual Eigen::Matrix4d ComputeTransformation(
63  const ccPointCloud &source,
64  const ccPointCloud &target,
65  const CorrespondenceSet &corres) const = 0;
66 };
67 
72 public:
77  TransformationEstimationPointToPoint(bool with_scaling = false)
78  : with_scaling_(with_scaling) {}
80 
81 public:
83  const override {
84  return type_;
85  }
86  double ComputeRMSE(const ccPointCloud &source,
87  const ccPointCloud &target,
88  const CorrespondenceSet &corres) const override;
89  Eigen::Matrix4d ComputeTransformation(
90  const ccPointCloud &source,
91  const ccPointCloud &target,
92  const CorrespondenceSet &corres) const override;
93 
94 public:
101  bool with_scaling_ = false;
102 
103 private:
104  const TransformationEstimationType type_ =
106 };
107 
112 public:
116 
120  std::shared_ptr<RobustKernel> kernel)
121  : kernel_(std::move(kernel)) {}
122 
123 public:
125  const override {
126  return type_;
127  };
128  double ComputeRMSE(const ccPointCloud &source,
129  const ccPointCloud &target,
130  const CorrespondenceSet &corres) const override;
131  Eigen::Matrix4d ComputeTransformation(
132  const ccPointCloud &source,
133  const ccPointCloud &target,
134  const CorrespondenceSet &corres) const override;
135 
136 public:
138  std::shared_ptr<RobustKernel> kernel_ = std::make_shared<L2Loss>();
139 
140 private:
141  const TransformationEstimationType type_ =
143 };
144 
145 } // namespace registration
146 } // namespace pipelines
147 } // namespace cloudViewer
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
std::shared_ptr< RobustKernel > kernel_
shared_ptr to an Abstract RobustKernel that could mutate at runtime.
TransformationEstimationPointToPlane(std::shared_ptr< RobustKernel > kernel)
Constructor that takes as input a RobustKernel.
double ComputeRMSE(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const override
Eigen::Matrix4d ComputeTransformation(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const override
bool with_scaling_
Set to True to estimate scaling, False to force scaling to be 1.
TransformationEstimationPointToPoint(bool with_scaling=false)
Parameterized Constructor.
Eigen::Matrix4d ComputeTransformation(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const override
double ComputeRMSE(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const override
virtual TransformationEstimationType GetTransformationEstimationType() const =0
virtual Eigen::Matrix4d ComputeTransformation(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const =0
virtual double ComputeRMSE(const ccPointCloud &source, const ccPointCloud &target, const CorrespondenceSet &corres) const =0
std::vector< Eigen::Vector2i > CorrespondenceSet
Generic file read and write utility for python interface.
Definition: Eigen.h:85