Open3D (C++ API)  0.17.0
CorrespondenceChecker.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2023 www.open3d.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <Eigen/Core>
11 #include <memory>
12 #include <string>
13 #include <vector>
14 
16 
17 namespace open3d {
18 
19 namespace geometry {
20 class PointCloud;
21 }
22 
23 namespace pipelines {
24 namespace registration {
25 
34 public:
39  CorrespondenceChecker(bool require_pointcloud_alignment)
40  : require_pointcloud_alignment_(require_pointcloud_alignment) {}
42 
43 public:
50  virtual bool Check(const geometry::PointCloud &source,
51  const geometry::PointCloud &target,
52  const CorrespondenceSet &corres,
53  const Eigen::Matrix4d &transformation) const = 0;
54 
55 public:
59 };
60 
71 public:
76  CorrespondenceCheckerBasedOnEdgeLength(double similarity_threshold = 0.9)
77  : CorrespondenceChecker(false),
78  similarity_threshold_(similarity_threshold) {}
80 
81 public:
82  bool Check(const geometry::PointCloud &source,
83  const geometry::PointCloud &target,
84  const CorrespondenceSet &corres,
85  const Eigen::Matrix4d &transformation) const override;
86 
87 public:
93 };
94 
99 public:
103  CorrespondenceCheckerBasedOnDistance(double distance_threshold)
104  : CorrespondenceChecker(true),
105  distance_threshold_(distance_threshold) {}
107 
108 public:
109  bool Check(const geometry::PointCloud &source,
110  const geometry::PointCloud &target,
111  const CorrespondenceSet &corres,
112  const Eigen::Matrix4d &transformation) const override;
113 
114 public:
117 };
118 
126 public:
130  CorrespondenceCheckerBasedOnNormal(double normal_angle_threshold)
131  : CorrespondenceChecker(true),
132  normal_angle_threshold_(normal_angle_threshold) {}
134 
135 public:
136  bool Check(const geometry::PointCloud &source,
137  const geometry::PointCloud &target,
138  const CorrespondenceSet &corres,
139  const Eigen::Matrix4d &transformation) const override;
140 
141 public:
144 };
145 
146 } // namespace registration
147 } // namespace pipelines
148 } // namespace open3d
A point cloud consists of point coordinates, and optionally point colors and point normals.
Definition: PointCloud.h:36
Check if two aligned point clouds are close.
Definition: CorrespondenceChecker.h:98
CorrespondenceCheckerBasedOnDistance(double distance_threshold)
Default Constructor.
Definition: CorrespondenceChecker.h:103
bool Check(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const override
Function to check if two points can be aligned.
Definition: CorrespondenceChecker.cpp:42
~CorrespondenceCheckerBasedOnDistance() override
Definition: CorrespondenceChecker.h:106
double distance_threshold_
Distance threshold for the check.
Definition: CorrespondenceChecker.h:116
Check if two point clouds build the polygons with similar edge lengths.
Definition: CorrespondenceChecker.h:70
double similarity_threshold_
Definition: CorrespondenceChecker.h:92
bool Check(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const override
Function to check if two points can be aligned.
Definition: CorrespondenceChecker.cpp:19
CorrespondenceCheckerBasedOnEdgeLength(double similarity_threshold=0.9)
Default Constructor.
Definition: CorrespondenceChecker.h:76
~CorrespondenceCheckerBasedOnEdgeLength() override
Definition: CorrespondenceChecker.h:79
Class to check if two aligned point clouds have similar normals.
Definition: CorrespondenceChecker.h:125
double normal_angle_threshold_
Radian value for angle threshold.
Definition: CorrespondenceChecker.h:143
bool Check(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const override
Function to check if two points can be aligned.
Definition: CorrespondenceChecker.cpp:59
~CorrespondenceCheckerBasedOnNormal() override
Definition: CorrespondenceChecker.h:133
CorrespondenceCheckerBasedOnNormal(double normal_angle_threshold)
Parameterized Constructor.
Definition: CorrespondenceChecker.h:130
Base class that checks if two (small) point clouds can be aligned.
Definition: CorrespondenceChecker.h:33
CorrespondenceChecker(bool require_pointcloud_alignment)
Default Constructor.
Definition: CorrespondenceChecker.h:39
virtual ~CorrespondenceChecker()
Definition: CorrespondenceChecker.h:41
virtual bool Check(const geometry::PointCloud &source, const geometry::PointCloud &target, const CorrespondenceSet &corres, const Eigen::Matrix4d &transformation) const =0
Function to check if two points can be aligned.
bool require_pointcloud_alignment_
Definition: CorrespondenceChecker.h:58
std::vector< Eigen::Vector2i > CorrespondenceSet
Definition: TransformationEstimation.h:27
Definition: PinholeCameraIntrinsic.cpp:16